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

[Discussion] Replace UTF-16 with UTF-8, where possible #1174

Open
davidebeatrici opened this issue Jul 19, 2020 · 0 comments
Open

[Discussion] Replace UTF-16 with UTF-8, where possible #1174

davidebeatrici opened this issue Jul 19, 2020 · 0 comments

Comments

@davidebeatrici
Copy link
Member

davidebeatrici commented Jul 19, 2020

The project originally always used UTF-16 for Unicode strings, possibly because it was initially developed for Windows.

UTF-8 is considered the proper standard (https://utf8everywhere.org), in fact the new JSON API uses it.

The problem lies in the rest of the codebase, where we have UTF-16 variants for a lot of functions.

Ideally we should only use UTF-16 when calling WinAPI functions, which can be done with MultiByteToWideChar().
Any UTF-16 strings we receive from WinAPI should be converted to UTF-8 as soon as possible, using WideCharToMultiByte().

Compatibility with the various management tools can certainly be maintained, however porting new code from/to the stable version (https://github.com/SoftEtherVPN/SoftEtherVPN_Stable) could be more difficult when Unicode strings are involved.

@davidebeatrici davidebeatrici pinned this issue Jul 19, 2020
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
@davidebeatrici and others