Hi Yongwei, my answer will probably not satisfy you, but perhaps it would be worth to think about it.
I would never dare to put non-ASCII characters straight to the C/C++ source code. There are two sources of problems - the text editor and the compiler. You never know what code page each of them accepts. So for Windows applications, even console application, I would suggest to put all such strings into the resource. The resource compiler can accept any code page (I believe even UTF-8) and the code page can be specified in the resource script. So you can be sure that the source rc file is saved in the proper code page, and the resource compiler will understand the code page. Then, if you load the string at runtime, you can be sure that the string is wchar_t - all strings are compiled as wide character strings in the resource, regardless the rc source code page. So again, my language is Czech, not very different script from English, but still, I would never put the special Czech characters to the C/C++ source code. Pavel On Tue, 2016-06-07 at 16:54 +0800, Yongwei Wu wrote: > Hi all, > > I am not sure whether it has been raised before here. I have a blog > that summarizes a big problem with MSVCRT.DLL: > > https://yongweiwu.wordpress.com/2016/05/27/msvcrt-dll-console-io-bug/ > > Whether intentional or not, I think Microsoft has screwed up the > multi-byte character support in MSVCRT.DLL for console I/O. > > I would like to ask whether anyone has a good idea about how to fix it. > > Best regards, > > Yongwei > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
