Aktuelle Änderungen Printable View Änderungen Bearbeiten
PythonSprache > PythonDoctest > PythonEggs > PythonEvangelism > PythonExecutables > PythonExif > PythonFunctionAnnotations > PythonHacks > PythonHacking > PythonIDE > PythonIDEs > PythonIdioms > PythonImageLibrary > PythonInTheEnterprise > PythonServerPages > PythonToJavascript > PythonUnicodeClear TrailWhen printing a string, Python will attempt to convert it to your default encoding, which is usually ASCII.[1]
>>> u'üöä'
u'\xfc\xf6\xe4'
>>> u"Hello World!" #create a Unicode string
u'Hello World!'
To construct the string, Python assumed that the literal input was in UTF8, the "default encoding".[2]So utf-16 is almost like the internal representation of unicode-strings in python. The raw string so to speak.>>> a.encode('utf-16') '\377\376A\000n\000d\000r\000\202\000'