a_string = 'à'.encode ('utf-8')
print (a_string)
b_string = '₩'.encode ('utf-8')
print (b_string)
a_bytes = a_string.decode ('utf-8')
print (a_bytes)
b_bytes = b_string.decode ('utf-8') # This line gives error: Character maps to undefined
print (b_bytes)
Ausgang ist:Python 3.5 kann das koreanische Won (Währung) Symbol nicht dekodieren?
Bin ich etwas falsch zu machen oder ist das ein Python 3.5 Problem?
Ausgabe:
import locale
print (locale.getdefaultlocale())
ist:
('en_US', 'cp1252')
Python Version 3.5.1
[EDIT]
Windows locale Problem Diese in der Tat stellt sich heraus, ist zu sein . Alles funktioniert gut unter Linux.
Adaequat cmd ändern (Python 3.5.2, ubuntu 16.10): https: // i.imgur.com/raQq0JP.png – falsetru
Ich habe Ihr Skript ohne Probleme auf Python 3.5.2 ausgeführt, was ist Ihre Version? – hansaplast
können Sie die Ausgabe von 'locale' in Ihre Frage eingeben? – hansaplast