New submission from Daniel U. Thibault <d.u.thiba...@gmail.com>:
https://docs.python.org/3/reference/import.html#importsystem
"Other mechanisms for invoking the import system (such as
importlib.import_module()) may choose to subvert __import__() and use its own
solution to imple
Daniel U. Thibault added the comment:
The default encoding is normally set to ASCII [...]. When a Unicode string is
printed, written to a file, or converted with str(), conversion takes place
using this default encoding.
uäöü
u'\xe4\xf6\xfc'
Printing a Unicode string uses ASCII encoding
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 stdin, line 1, in module
UnicodeEncodeError: 'ascii' codec
Daniel U. Thibault added the comment:
It seems to me the statement is correct as written. What experiments indicate
otherwise?
Here's a simple one:
print «1»
The guillemets are certainly not ASCII (Unicode AB and BB, well outside ASCII's
7F upper limit) but are rendered as guillemets
New submission from Daniel U. Thibault:
Near the end of 3.1.3
http://docs.python.org/2/tutorial/introduction.html#unicode-strings you can
read:
When a Unicode string is printed, written to a file, or converted with str(),
conversion takes place using this default encoding.
This can