Author prikryl
Date 2005-01-10.10:33:24
SpamBayes Score
Marked as misclassified
I have observed a problem when running 
Python 2.4, Windows version (python-2.4.msi)
and using raw_input() with unicode prompt
string in a console program (ran in the DOS window).

I do use the following file to set
the default encoding in the English Windows 2000 Server:
import sys
# -*- coding: cp1250 -*-
s = u'string with accented letters (different than this)'
print s                    # OK
val = raw_input(s)    # s displayed differently (wrong)

See the test.png
(captured from screen) and the for the
used string -- inside the attached zip file. 

The "type" (result visible on the captured
screen) displays the string
definition also wrongly, because the DOS window
uses different encoding than cp1250. The print
command prints the string correctly, converting
the internal unicode string to the encoding that
the is defined by the output environment. However,
the raw_input() probably does convert the unicode
string to the cp1250 and does not do the same
(more clever) thing that the print does.

I did not use the unicode in older Python (2.3.4),
so I do not know what was the behaviour earlier.

Could you confirm the bug? Sorry if the bug
is well known.

Date User Action Args
2007-08-23 14:28:54adminlinkissue1099364 messages
2007-08-23 14:28:54admincreate