WinXP was even more buggy.
In order to not crash the default WinXP consoIe, i first had to change the batch to:
Code: Select all
@echo off &setlocal
(chcp 65001 & type "bug_test.txt" & chcp 850)
That's (a part of) the output i got:
Code: Select all
┬┤ÔòùÔöÉÔö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ ┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
O ├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝òØ├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ Ôö£ÔòØ├ö├®┬╝
Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝Ôö£ÔòØ├ö├®┬╝
Ôö£ ┬╝Ôö£ÔòØ├ö├®┬╝
Finally i think i found how to explain the output (WinXp console uses utf-8 twice:
Code: Select all
Textfile glyphs : ü€
encoded in utf-8 : C3 BC, E2 82 AC
interpreted as cp 850 codepoints: C3, BC, E2, 82, AC
displayed as cp 850 glyphs : ├╝Ôé¼
mapped to Unicode codepoints : U+251C, U+255D, U+D4, U+E9, U+BC
encoded in utf-8 : E2 94 9C, E2 95 9D, C3 94, C3 A9, C2 BC
interpreted as cp 850 codepoints: E2 94 9C, E2 95 9D, C3 94, C3 A9, C2 BC
displayed as cp 850 glyphs : Ôö£ÔòØ├ö├®┬╝
I think it uses cp 850 because that is the default dos codepage set in registry - but i'm not sure.
If i read the output right, then the bug is applied two times (on each utf-8 encoding step) in WinXP... .
(

I wonder if you could get the bug applied three times in WinXP if using cp 932 as default dos codepage... .)
Sidenote:
When redirecting to a file, here on WinXP also no error occurs, like in win10.
penpen