microsoft/cpprestsdk

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

オープン

#101 opened on 2016/03/23

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (1,670 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (7,596 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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?

コントリビューターガイド