ich UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 0: invalid continuation byte
Python3 Unicode Decode Fehler
Wenn ich versuche, codecs.decode(X, 'utf-8')
zu nennen, wo X = b'\xe8\xd0\[email protected]\xee\xe4\xca\xc6\[email protected]\xde\[email protected]\xe8\xd0\[email protected]\xd0\xca\xe6\xe0\xca\xe4\xea\xe6\x14\xc4\[email protected]\xd0\xca\xdc\xe4\[email protected]\xee\xc2\xc8\xe6\xee\xde\xe4\xe8\[email protected]\xd8\xde\xdc\xce\xcc\xca\xd8\xd8\xde\xee\x14\x14\xd2\[email protected]\xee\xc2\[email protected]\xe8\xd0\[email protected]\xe6\xc6\xd0\xde\xde\xdc\xca\[email protected]\xd0\xca\xe6\xe0\xca\xe4\xea\xe6\[email protected]@@@@@\xe8\xd0\xc2\[email protected]\xe6\xc2\xd2\xd8\xca\[email protected]\xe8\xd0\[email protected]\xee\xd2\xdc\xe8\xe4\[email protected]\xe6\xca\xc2\x14\xc2\xdc\[email protected]\xe8\xd0\[email protected]\xe6\xd6\xd2\xe0\xe0\xca\[email protected]\xd0\xc2\[email protected]\xe8\xc2\xd6\xca\[email protected]\xd0\xd2\[email protected]\xd8\xd2\xe8\xe8\xd8\[email protected]\xc8\xc2\xea\xce\xd0\xe8\xca\xe4\[email protected]@@@@@\xe8\[email protected]\xc4\xca\xc2\[email protected]\xd0\xd2\[email protected]\xc6\xde\xda\xe0\xc2\xdc\xf2\\\x14\x14\xc4\xd8\xea\[email protected]\xee\xca\xe4\[email protected]\xd0\xca\[email protected]\xca\xf2\xca\[email protected]\xc2\[email protected]\xe8\xd0\[email protected]\xcc\xc2\xd2\xe4\xf2Z\xcc\xd8\xc2\xf0\[email protected]@@@@@\xd0\xca\[email protected]\xc6\xd0\xca\xca\xd6\[email protected]\xd8\xd2\xd6\[email protected]\xe8\xd0\[email protected]\xc8\xc2\xee\[email protected]\xde\[email protected]\xc8\xc2\xf2\x14\xc2\xdc\[email protected]\xd0\xca\[email protected]\xc4\xde\xe6\xde\[email protected]\xee\xd0\xd2\xe8\[email protected]\xc2\[email protected]\xe8\xd0\[email protected]\xd0\xc2\xee\xe8\xd0\xde\xe4\[email protected]\xc4\xea\xc8\xe6\[email protected]@@@@@\xe8\xd0\xc2\[email protected]\xde\xe0\[email protected]\xd2\[email protected]\xe8\xd0\[email protected]\xda\xde\xdc\xe8\[email protected]\xde\[email protected]\xda\xc2\xf2\\\x14\x14\xe8\xd0\[email protected]\xe6\xd6\xd2\xe0\xe0\xca\[email protected]\xd0\[email protected]\xe6\xe8\xde\xde\[email protected]\xc4\xca\xe6\xd2\xc8\[email protected]\xe8\xd0\[email protected]\xd0\xca\xd8\xda\[email protected]@@@@@\xd0\xd2\[email protected]\xe0\xd2\xe0\[email protected]\xee\xc2\[email protected]\xd2\[email protected]\xd0\xd2\[email protected]\xda\xde\xea\xe8\xd0\x14\xc2\xdc\[email protected]\xd0\[email protected]\xee\xc2\xe8\xc6\xd0\xca\[email protected]\xd0\xde\[email protected]\xe8\xd0\[email protected]\xec\xca\xca\xe4\xd2\xdc\[email protected]\xcc\xd8\xc2\[email protected]\xc8\xd2\[email protected]\xc4\xd8\xde\xee\[email protected]@@@@@\xe8\xd0\[email protected]\xe6\xda\xde\xd6\[email protected]\xdc\xde\[email protected]\xee\xca\xe6\[email protected]\xdc\xde\[email protected]\xe6\xde\xea\xe8\xd0\\\x14\x14\xe8\xd0\xca\[email protected]\xea\[email protected]\xc2\xdc\[email protected]\xe6\xe0\xc2\xd6\[email protected]\xc2\[email protected]\xde\xd8\[email protected]\xe6\xc2\xd2\xd8\xde\xe4\[email protected]@@@@@\xd0\xc2\[email protected]\xe6\xc2\xd2\xd8\xca\[email protected]\xe8\[email protected]\xe8\xd0\[email protected]\xe6\xe0\xc2\xdc\xd2\xe6\[email protected]\xda\xc2\xd2\xdc\x14\[email protected]\xe0\xe4\xc2\[email protected]\xe8\xd0\xca\[email protected]\xe0\xea\[email protected]\xd2\xdc\xe8\[email protected]\xf2\xde\xdc\xc8\xca\[email protected]\xe0\xde\xe4\xe8\[email protected]@@@@@\xcc\xde\[email protected]\[email protected]\xcc\xca\xc2\[email protected]\[email protected]\xd0\xea\xe4\xe4\xd2\xc6\xc2\xdc\xca\\\x14\x14\xd8\xc2\xe6\[email protected]\xdc\xd2\xce\xd0\[email protected]\xe8\xd0\[email protected]\xda\xde\xde\[email protected]\xd0\xc2\[email protected]\[email protected]\xce\xde\xd8\xc8\xca\[email protected]\xe4\xd2\xdc\xce\[email protected]@@@@@\xc2\xdc\[email protected]\xe8\xdeZ\xdc\xd2\xce\xd0\[email protected]\xdc\[email protected]\xda\xde\xde\[email protected]\xee\[email protected]\xe6\xca\xca\x14\xe8\xd0\[email protected]\xe6\xd6\xd2\xe0\xe0\xca\[email protected]\xd0\[email protected]\xc4'
ich auch binascii.unhexlify('%x' % (int('0b' + bNum, 2))).decode('utf-8')
zu verwenden versucht, wo bNum
eine lange binäre Zeichenfolge ist
Der Text war ursprünglich von einem utf -8 codiert Datei
EDIT: Sagen wir, wir haben zwei Bit-Strings, die erste ist die genaue Bit-String von der Umwandlung von Text zu eine Bitfolge. Die Sekunde wird aus einem Bild extrahiert. Die Sekunde ist genau die gleiche wie die erste bis zu dem Punkt, an dem sie abgeschnitten wurde, weil das Bild, in dem sie versteckt wurde, nicht genug Pixel hatte.
Beispiel: http://pastebin.com/NnaH9dEb
warum es UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 0: invalid continuation byte
Fehler werfen würden, wenn sie beide die gleichen Daten bis zu dem Punkt, der zweite schneidet enthalten?
EDIT2: Wenn ich die zwei Bit-Zeichenfolgen über hex(int(<var name>, 2))
in Hex konvertieren, bekomme ich unterschiedliche Ergebnisse, aber die Konvertierung nur der ersten paar Bytes gibt das gleiche Ergebnis zurück.
würde ich Ihre Annahme in Frage stellen, dass die Quelle war UTF-8 codiert. –
@MarkRansom Ich habe es zuvor mit Notepad ++ überprüft und wieder gespeichert und ich habe es gerade noch einmal gemacht, ich habe immer noch das selbe Problem. –
@MarkRansom Hier ist der Code zu meinem Programm, wenn Sie einen Blick darauf werfen möchten: http://pastebin.com/ZibMjms3 Es verbirgt den Text in einem Bild. Dann bekomme ich diesen Fehler, wenn ich versuche, es abzurufen, also ist es vielleicht meine Versteck-Funktion, die das Problem verursacht. Das Problem tritt nur auf, wenn der Text, der in das Bild eingefügt werden soll, die Größe des Bildes überschreitet (nicht genug Pixel, um jedes Bit zu platzieren, um später den Text zu rekonstruieren). Mit reinem UTF-8-Text wie Russisch funktioniert es gut und schneidet nur ab, was nicht in das Bild passt, aber mit normalen englischen Zeichen gibt es mir diesen Fehler. –