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

Use UTF16 versions of Windows API functions #129

Open
peci1 opened this issue Nov 23, 2020 · 1 comment
Open

Use UTF16 versions of Windows API functions #129

peci1 opened this issue Nov 23, 2020 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@peci1
Copy link
Contributor

peci1 commented Nov 23, 2020

Most of ign-common is using the ASCII versions of Windows API functions. These should be converted to the ones using wchar_t (UTF16) strings. The ASCII API is prone to text encoding problems, whereas the UTF16 API doesn't have an issue.

This would probably also deserve a helper function to convert std::string<char> to std::wstring (std::string<wchar_t>). https://stackoverflow.com/questions/4804298/how-to-convert-wstring-into-string might be a good start for this function, as it really isn't as trivial as one would think.

@peci1
Copy link
Contributor Author

peci1 commented Nov 23, 2020

A part of the usages can be completely eliminated by switching to C++17 filesystem library. The main blocker would probably be XCode 10, which does not support filesystem (although it supports a big part of C++17, filesystem is not there - https://developer.apple.com/documentation/xcode-release-notes/xcode-11-release-notes#New-Features ).

@chapulina chapulina added the help wanted Extra attention is needed label Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants