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]);
}

Reply via email to