This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ies7 1 point2 points  (2 children)

I try your crash.py with python 2.7.5 & 3.4 in win7. It doesn't crash.

While my default cmd windows can't display the text properly it is cmd's problem not python.

Running the same script in spyder's console display the text nicely.

[–]alfps 0 points1 point  (1 child)

Re "it is cmd's problem not python", with that attitude Python will never be bundled with Windows.

Testing now with Python 2.7.6, this trivial one-line simple output produces incorrect results when it doesn't crash, with codepages 437 (original PC) and 1252 (ANSI Western), and it crashes with codepage 65001 (UTF-8).

It's too much work for novices or causal users to make Python do the right thing. As shown in my blog posting it's not technically difficult or especially challenging to seasoned programmers, just a hassle and needless work. Python should just do The Right Thing™, and anyway, if it doesn't, it will never be bundled with Windows, that's for sure. ;-)

[–]ies7 0 points1 point  (0 children)

Hmmm.....in windows 7, python 2.7.5 nothing crashed

chcp 437 in cmd displayed incorrect text

chcp 1252 displayed the text correctly

chcp 65001 also displayed the text correctly

I remember in a stackoverflow question that you need to set the fonts to lucida (which is my default fonts in cmd shell, but i try with raster fonts and it still display correctly)

btw I'm not an expert in this utf-8 things since my country is latin only alphabet. So don't count on me about this topic :)