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

Wrong encoding for cf::Url::with_path #25

Closed
kusaanko opened this issue Nov 7, 2024 · 1 comment
Closed

Wrong encoding for cf::Url::with_path #25

kusaanko opened this issue Nov 7, 2024 · 1 comment

Comments

@kusaanko
Copy link

kusaanko commented Nov 7, 2024

To convert from Rust's Path to URL, I used cf::Url::with_path.
But the generated string is used wrong encoding.
My macOS uses Japanese.

MacBook Airのマイク is converted to MacBook Air縺ョ繝槭う繧ッ

I changed

let encoding = cf::StringEncoding::sys_encoding();
to

cf::StringEncoding::UTF8

then the conversion succeeded.

My system returns kCFStringEncodingMacJapanese = 1 from StringEncoding::sys_encoding().

macOS uses UTF-8(NFD) as file names, so the conversion fails?

@yury yury closed this as completed in bb09087 Nov 7, 2024
@yury
Copy link
Owner

yury commented Nov 7, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants