I check it again,found that I actually use MSVCRT instead of UCRT. And so
strange that the MSVCRT is working but UCRT failed.

傅继晗 <[email protected]> 于2023年3月20日周一 19:25写道:

> No.I think msvcrt is outdated.So I use ucrt instead.
>
> LIU Hao <[email protected]> 于2023年3月20日周一 19:05写道:
>
>> 在 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
>>
>>

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

Reply via email to