在 2022/11/14 05:48, Martin Storsjö 写道:
-#ifdef _MBCSThe existing code checked the flag _MBCS here. I don't see anything in mingw-w64 setting this flag (nothing in headers, nothing in crt makefiles). I also grepped through both GCC and Clang source, and there's no mentions of this define anywhere there either, so it doesn't seem to be predefined by the compiler.Thus, I would think that this codepath isn't actually in use. So therefore, changing it into "#ifndef _UNICODE" is a functional change here.The change is probably benign/beneficial though, but it would be good to separate out such funtional changes and/or acknowledge them clearly.
In GBK (.936 for Simplified Chinese) [1], Big5 (.950 for Traditional Chinese) [2] and Shift JIS (.932 for Japanese) [3], the second byte of a double-byte sequence is always within the range [0x40,0x7E] union [0x80,0xFE], and cannot match an ASCII double-quote character (0x22). So i suspect the code path was unused and practically never caused any problems. But I think it's not a functional change; it's just an oversight that used to work by accident.
[1] https://en.wikipedia.org/wiki/GBK_(character_encoding) [2] https://en.wikipedia.org/wiki/Big5 [3] https://en.wikipedia.org/wiki/Shift_JIS -- Best regards, LIU Hao
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
