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

Fixes string casting of paths that may contains Unicode characters. #199

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

Doflatango
Copy link
Contributor

@Doflatango Doflatango commented Oct 13, 2022

This PR fixed the user_data_directory string casting, which will causes some unexcepted behaviors if string contains Unicode characters:

1. If the user has permission to create directorys, for example:

Excepted user data directory:

C:\Users\Username\AppData\Roaming\myapp\缓存

Actually user data directory:

C:\Users\Username\AppData\Roaming\myapp\￧ᄐモ¥ᆳリ

The WebView2 will creates the directory as a garbled name ￧ᄐモ¥ᆳリ, which is unexcepted.

2. If the user does not have write permission, for example, a windows username with Unicode characters:

Excepted user data directory:

C:\Users\缓存\AppData\Roaming\myapp\weview\cache

Actually user data directory:

C:\Users\￧ᄐモ¥ᆳリ\AppData\Roaming\myapp\weview\cache

This time the Weview2 will try to create directories C:\Users\￧ᄐモ¥ᆳリ and may got failed.

@Doflatango
Copy link
Contributor Author

Hi @jnschulze i have updated the comments, please have a look at it.

@jnschulze jnschulze merged commit 2715df1 into jnschulze:main Oct 15, 2022
@jnschulze
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants