Getting strange characters in the command prompt

Martin v. Loewis martin at v.loewis.de
Wed Jan 7 05:52:31 CET 2004


sebb wrote:

> # -*- coding: cp1252 -*-
> print "é à è"
> 
> ... and I run it in the windows command prompt, I get strange
> characters I didn't ask for.
> 
[...]
> Can anyone help we with that problem?

As Irmen explains, this is because cmd.exe uses code page 850
(on your installation). You should write

print u"é à è"

Regards,
Martin




More information about the Python-list mailing list