
Alf P. Steinbach wrote:
But, you may ask, what about Alf's program, then, it's the same for heaven's sake?
Well, let's check:
<example> P:\test> chcp 1252 Active code page: 1252
P:\test> a Blåbærsyltetøy! 日本国 кошка!
Neat trick. Apparently, _O_U8TEXT switches to Unicode mode when stdout is a console. Let me try... | C:\Projects\testbed>chcp | Active code page: 437 | | C:\Projects\testbed>release\testbed.exe | Blåbærsyltetøy! 日本国 кошка! Yeah. | C:\Projects\testbed>release\testbed.exe | more | Bl├Ñb├ªrsyltet├╕y! µùѵ£¼σ¢╜ ╨║╨╛╤ê╨║╨░! Well. You can't have everything. :-) | C:\Projects\testbed>release\testbed.exe > testbed.txt | | C:\Projects\testbed>type testbed.txt | Bl├Ñb├ªrsyltet├╕y! µùѵ£¼σ¢╜ ╨║╨╛╤ê╨║╨░! | | C:\Projects\testbed>chcp 65001 | Active code page: 65001 | | C:\Projects\testbed>type testbed.txt | Blåbærsyltetøy! 日本国 кошка! Of course, chcp 65001 breaks everything and more. Not that more worked in the first place. :-)