Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Bug report) Import file with Chinese char in file name cause random char in file name after import #3013

Closed
shutaozhenzhen opened this issue Jul 26, 2022 · 5 comments

Comments

@shutaozhenzhen
Copy link

Trilium Version

0.53.2

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

windows 10 1809

Description

Import file with Chinese char in file name cause random char in file name after import.

@zadam
Copy link
Owner

zadam commented Jul 27, 2022

Hi, sorry for late response, are you importing notes in ZIP or directly from filesystem? ZIP has the issue that it assumes UTF-8 encoding, but as I learned most chinese software pack with a different encoding.

@shutaozhenzhen
Copy link
Author

directly from filesystem

@zadam
Copy link
Owner

zadam commented Jul 28, 2022

could you post some screenshot of the original filename and imported? To have an idea how the characters get mangled ...

@shutaozhenzhen
Copy link
Author

image
image
image
image
image
image
测试.txt is a empty file with Chinese char filename
And my systerm charset is non-unicode(gbk)
image

@zadam
Copy link
Owner

zadam commented Jul 29, 2022

I see, my guess is that you're using non-unicode system encoding. Trilium is tested (and thus supported) only on unicode encoding.

Of course, if the fix is simple enough then PR is welcome.

@zadam zadam closed this as completed in d1f3ce0 Aug 14, 2022
zadam added a commit that referenced this issue Aug 14, 2022
Fix UTF-8 file name encoding for uploads (fixes #3013)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants