1

I have a file that contains some characters whose "number" is greater than 127. If I use type file.txt to display the content of the file in a cmd.exe console whose code page (chcp) is set to 437, these characters are prepended with a character. I don't understand why this is and if there is a possibility to turn that off.

René Nyffenegger
  • 2,249
  • 7
  • 33
  • 46
  • Did you read the Wikipedia page about [codepage 437](https://en.wikipedia.org/wiki/Code_page_437)? It contains a lot of information about the origins. – Doc Brown Aug 09 '19 at 18:42
  • Your text seems to be [UTF8](https://en.wikipedia.org/wiki/UTF-8#Comparison_with_single-byte_encodings) encoded, try to change `chcp 65001` – LotPings Aug 09 '19 at 20:10
  • @LotPings: that was indeed the case. Please turn your comment into an answer so that I can accept it. – René Nyffenegger Aug 10 '19 at 05:35
  • Did you trying changing encoding to UTF8NoBom or ASCII? – Zimba Jun 19 '21 at 19:05

1 Answers1

1

In codepage 437 the glyph is assigned to hex 0xC2 / dec 194.

I did remember that some UTF8 2 byte encodings start with 0xC2 so the conclusion the text is in this encoding was obvious to me.

To display UTF8 in cmd you'll need Codepage 65001

chcp 65001  
LotPings
  • 7,011
  • 1
  • 15
  • 29