Skip to content

Conversation

@personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Jan 13, 2026

Summary

Fixes #14084 by changing how .onepkg files are extracted.

Details

Previously, Joplin used the Windows built-in expand.exe to extract .one files from .onepkg files. However, expand.exe doesn't correctly extract files containing non-ASCII characters (e.g. è) and is only present on Windows.

This pull request replaces expand.exe with the Rust cab crate. In addition to correctly handling Unicode characters in filenames, the cab crate works on Linux and MacOS.

New dependency: cab v0.6.0

Notes

Notes on alternatives:

  • expand.exe: Even with the terminal code page set to UTF-8 (with chcp), file names are incorrectly decoded.
  • C++ API: Windows seems to also have a C++ API for extracting .cab files. We might be able to use this.
  • Renaming .onepkg files to .cab and opening them in Windows Explorer also results in badly-encoded file names:
    Windows explorer: files in tést.cab include 'Open Notebook.onetoc2', 'TÃⓒst!.one'

Testing

Manual testing:

  1. Windows 11, Ubuntu 25.10: Import "testowy.onepkg" from Import from OneNote issue #14084. Verify that the imported folder has title "Głupoty".
  2. Ubuntu 25.10: Import "Carnet de test migration Joplin - 2025-10-21.onepkg" from Fix issues with import of OneNote files #13549. Verify that three sub-notebooks are imported: "Procédures", "Ma section 2", and "Ma section 1".

This pull request adds a new automated test.

To-do: Improve support/test importing very large .onepkg files.
Currently, the input .onepkg file is read into memory all at once, then
processed. Better would be to read chunks into memory as necessary.
@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: Fixes #14084: Improve .onepkg import: Fix Unicode issues, support Linux and MacOS Desktop: Fixes #14084: .onepkg import: Fix Unicode issues, support Linux and MacOS Jan 13, 2026
@personalizedrefrigerator personalizedrefrigerator added v3.6 import Related to importing files such as ENEX, JEX, etc. labels Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

import Related to importing files such as ENEX, JEX, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import from OneNote issue

2 participants