This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/79511] Convertation issues in std::codecvt_utf8_utf16
- From: "mikhail at pilin dot name" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Feb 2017 20:41:34 +0000
- Subject: [Bug libstdc++/79511] Convertation issues in std::codecvt_utf8_utf16
- Auto-submitted: auto-generated
- References: <bug-79511-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79511
--- Comment #9 from ww898 <mikhail at pilin dot name> ---
#include <iostream>
#include <codecvt>
#include <string>
#include <iomanip>
int main()
{
static char const src[] = "\xE2\x82\xAC";
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> conv;
auto const dst = conv.from_bytes(src);
std::cout << std::hex << std::setw(4) << std::setfill('0') << (unsigned)
dst[0] << std::endl;
}
Output:
MSVC: 0x20ac
Clang: 0x20ac
GCC: 0xac20
P.S. http://rextester.com/PRPX46172