Desktop: Fixes #14084: .onepkg import: Fix Unicode issues, support Linux and MacOS #14094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #14084 by changing how
.onepkgfiles are extracted.Details
Previously, Joplin used the Windows built-in
expand.exeto extract.onefiles from.onepkgfiles. However,expand.exedoesn't correctly extract files containing non-ASCII characters (e.g.è) and is only present on Windows.This pull request replaces
expand.exewith the Rustcabcrate. In addition to correctly handling Unicode characters in filenames, thecabcrate works on Linux and MacOS.New dependency:
cabv0.6.0anstream,anyhow-related alerts (e.g. install scripts, file system access):anstreamandanyhoware not production dependencies.byteorderflate2lxzdtimeNotes
Notes on alternatives:
expand.exe: Even with the terminal code page set to UTF-8 (withchcp), file names are incorrectly decoded..cabfiles. We might be able to use this..onepkgfiles to.caband opening them in Windows Explorer also results in badly-encoded file names:Testing
Manual testing:
This pull request adds a new automated test.