在 2025-6-3 18:02, Kirill Makurin 写道:
Ah, so UCRT does the right thing? I was not aware of this behavior for "POSIX" locale.I still wonder whether MSVCRT's btowc succeeds when GetACP() != CP_UTF8. If it converts using code page retuned by GetACP(), this means that replacement has the same behavior.
No. I meant the UCRT function should be standard. The POSIX locale seems to define that characters within [128,255] are zero-extended:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03The issue here is that we replace MSVCRT `btowc()` with a custom implementation in 'mingw-w64-crt/misc/btowc.c'. I think you may try calling the genuine MSVCRT one, which is returned by `GetProcAddress()`.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public