Non-ascii characters in an MSDOS window

Bartolomé Sintes Marco BartolomeSintes at ono.com
Thu Oct 17 16:28:23 EDT 2002


Hi,

I am using Python 2.2.2 for Windows in a computer with a Spanish Windows 98
SE operating
system. I have written the following program (sample.py)

print "Spanish accents: á é í ó ú"
end = raw_input()

If I run this program in IDLE (Ctrl+F5), Python writes the accents
correctly, but if I double-click
the sample.py file, an MS-DOS window opens and wrong symbols are written.

I have tried to use sys.setdefaultencoding() in sitecustomize.py file, but I
always get the same
wrong characters in the MSDOS Windows no matter which encoding I use.

Is there an easy way to make Python write the same characters in a MSDOS
window than in IDLE?

Thanking you in advance,
Barto





More information about the Python-list mailing list