[issue20686] Confusing statement about unicode strings in tutorial introduction

2020-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2.7 is no longer supported. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___

[issue20686] Confusing statement about unicode strings in tutorial introduction

2014-03-20 Thread Georg Brandl
Georg Brandl added the comment: First, entering a string at the command prompt like this is not considered "printing"; it's invoking the repr(). Then, when you say flexible, you say it as if it's a good thing. In this context "flexible" means as much as "easy to produce mojibake" and is not

[issue20686] Confusing statement about unicode strings in tutorial introduction

2014-03-20 Thread Daniel U. Thibault
Daniel U. Thibault added the comment: >>> mystring="äöü" >>> myustring=u"äöü" >>> mystring '\xc3\xa4\xc3\xb6\xc3\xbc' >>> myustring u'\xe4\xf6\xfc' >>> str(mystring) '\xc3\xa4\xc3\xb6\xc3\xbc' >>> str(myustring) Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'asci

[issue20686] Confusing statement about unicode strings in tutorial introduction

2014-03-20 Thread R. David Murray
R. David Murray added the comment: re: file. You forgot the 'u' in front of the string: >>> f.write(u'This is a «test»\n') Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xab' in position 10: ordinal not in range(128) So yo