2013/2/12 Erwin Waterlander <email@example.com>
Msys cat is a windows program. I think the msys terminal runs in the
same code page as cmd.exe. But cat tries to be smart and does a fuzzy
translation to CP850. It translates the promille symbol to a percent
symbol, and OE (0x8c) to O. I cannot find any documentation on this
translation of cat.
I would assume the encoding is the same as cmd.exe as well, just because it's the same terminal, the Windows console. Well, unless you're using rxvt, MinTTY or something else, and unless bash is doing something in the middle. Yes, I see the same crazy conversion of cat's output in Windows console. A few tests here:
- The cat command applied to a Latin1 text file shows its contents as the active codepage in Windows console, CP850. I would expect the output to be displayed erroneously as if it was CP850 instead, just like cmd.exe's type does for the same text file.
- A script I wrote, which prints in CP850 by default, is displayed correctly as CP850, as expected.
- A testing program written as Latin1 prints text correctly as Latin1 mistook for CP850. However, when the output is piped to cat (both in bash and cmd.exe), it gets displayed as if the bytes themselves were CP850. I would expect the pipe operation to not change anything.
2013/2/13 Earnie Boyd <firstname.lastname@example.org>
The cat binary supplied by MSYS sends binary streams of data to the
terminal. It is the terminal's job to interpret the data. No conversion is done by cat; that is just a misunderstanding of what