This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/69703] char16_t conversions broken in filesystem::path
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 19 Apr 2016 14:23:24 +0000
- Subject: [Bug libstdc++/69703] char16_t conversions broken in filesystem::path
- Auto-submitted: auto-generated
- References: <bug-69703-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69703
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I'm incorrectly switching endianness in codecvt_utf8<char16_t>, it's not a
problem in filesystem:
#include <codecvt>
#include <stdio.h>
int main() {
const char out[] = "abc";
char16_t in[4];
std::codecvt_utf8<char16_t> cvt;
std::mbstate_t st;
const char* no;
char16_t* ni;
cvt.in(st, out, out+3, no, in, in+3, ni);
printf("%d %d %d\n", (int)in[0], (int)in[1], (int)in[2]);
}