在 2023/3/20 18:52, Alvin Wong via Mingw-w64-public 写道:
Thanks for sending the patches. However my comment on these patches will be that, they only work when the process ANSI codepage (ACP) is UTF-8, which requires either embedding a manifest with activeCodePage set to UTF-8 or setting the system ACP to UTF-8. If the process is using CP936 (GBK) for example, it will still be broken similar to before.

Does this work for you with MSVCRT? As far as I recall MSVCRT doesn't support UTF-8 at all, so you will need UCRT at least. But anyway, there are other issues:


Just my two cents: I would prefer to remove any code that changes the locale then attempt to restore it (which is not thread-safe), then replace `mbstowcs` and `wcstombs` with direct usage of `MultiByteToWideChar` and `WideCharToMultiByte`, which can convert from/to CP_ACP directly.

I totally agree with that.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to