Python unicode and Windows cmd.exe

Neil Hodgson nyamatongwe+thunder at gmail.com
Sun Mar 14 17:35:51 EDT 2010


Guillermo:

> Is this an enforced convention under Windows, then? My head's aching
> after so much pulling at my hair, but I have the feeling that the
> problem only arises when text travels through the dos console...

   The console is commonly using Code Page 437 which is most compatible
with old DOS programs since it can display line drawing characters. You
can change the code page to UTF-8 with
chcp 65001
   Now, "type m.txt" with the original BOM-less file and it should be
OK. You may also need to change the console font to one that is Unicode
compatible like Lucida Console.

   Neil



More information about the Python-list mailing list