1

I was working on a Ruby program and had issues that I finally found out were caused by the default encoding in Windows 10 terminal, which apparently is CP850, an encoding so old it doesn't even include the € symbol. I read that, of course, if I try to change this other programs around the computer will give issues.

Wikipedia indicates that CP850 has theorically been "largely replaced" by Windows-1252 and, later, Unicode, and yet it's here, right in the OS's terminal.

Picture attached as proof. It's in italian language but you'll see it under "Tabella codici corrente", aka "Current code table".

How's that possible?

Knock knock, it's CP850

  • Does this answer your question? [Using UTF-8 Encoding (CHCP 65001) in Command Prompt / Windows Powershell (Windows 10)](https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window) – JosefZ Jul 16 '20 at 14:46
  • I was actually more interested in the historical reasons for which CP850 is still there, actually. – il mietitore Jul 16 '20 at 17:42

1 Answers1

3

This is historical.

DOS had cp437, and later cp850 (and e.g. also cp852) as standard code page.

Terminal in Windows was also known as "DOS prompt": so a way to run DOS programs in Windows, so they keep the code page of DOS. Microsoft dislikes non-backward compatible changes, so your DOS program should works also on Windows terminal without problem.

Windows-1252, as the name stress it out, was done for Windows, so no compatibility problem, and for Windows programs, but so, in order to gain graphical interface market, but keeping compatibility with many business applications, Microsoft maintained two different code page.

Giacomo Catenazzi
  • 8,519
  • 2
  • 24
  • 32