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

utility::conversions::latin1_to_utf16 - Is there a bug for characters above 0x80? #101

Open
pp555 opened this issue Mar 23, 2016 · 1 comment

Comments

@pp555
Copy link
Contributor

pp555 commented Mar 23, 2016

I've tried to use utility::conversions::latin1_to_utf16 to convert latin1 string to UTF-16. The string contained 'í' character (0xed). After converting it should become 0x00ed but it seems that converting method replaced it with 0xffed.

I think this may be result of casting signed char to utf16char and dest[i] = utf16char(s[i]); in asyncrt_utils.cpp should be replaced by dest[i] = utf16char(static_cast<unsigned char>(s[i])); to fix it. Can someone check if I'm right?

@ras0219-msft
Copy link
Contributor

This could very well be an issue. Please consider making a PR with the fix and a test case; it would be gladly accepted.

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