I can update patch I initially attached to: For btowc, check for value to be in range [0,255] instead of [0,127].
For wctob, remove range check and use code page 20127 (ASCII) for conversion (so it matches CRT's best-fit behavior). - Kirill Makurin ________________________________ From: LIU Hao Sent: Thursday, June 5, 2025 1:04 PM To: Kirill Makurin; mingw-w64-public@lists.sourceforge.net Subject: Re: [Mingw-w64-public] Inconsistent behavior of btowc with "C" locale 在 2025-6-3 19:40, Kirill Makurin 写道: > I think glibc just did not implement this behavior yet. There have been > nearly zero real changes to its > `btowc` since like 2007. > > https://sourceware.org/git/?p=glibc.git;a=history;f=wcsmbs/ > btowc.c;h=7be040ff6688d31da585d9075bdee54d231550d1;hb=refs/heads/master > <https://sourceware.org/git/? > p=glibc.git;a=history;f=wcsmbs/btowc.c;h=7be040ff6688d31da585d9075bdee54d231550d1;hb=refs/heads/master> > > I think it should be ok for replacement's behavior to match CRT. > I agree with that. -- Best regards, LIU Hao _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public