This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/69703] char16_t conversions broken in filesystem::path


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]