LSB-Steganography icon indicating copy to clipboard operation
LSB-Steganography copied to clipboard

UnicodeDecodeError

Open MalcontentLout opened this issue 6 years ago • 3 comments

Whenever trying to decode an image, I get UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 0: ordinal not in range(128) from line 166 (output += chr(int(self.read_byte(),2)).encode("utf-8")). The problematic byte changes depending on the image. This happens whenever the format of the carrier is a bmp or png and the file is an image. Text can be successful encoded and decoded, but images produce this error during extraction. By importing and reseting sys with default encoding as UTF8, the error persists as a UnicodeDecodeError but with UTF-8 codec unable to decode the byte because of an invalid start byte instead.

MalcontentLout avatar Sep 24 '17 17:09 MalcontentLout

Which Python version are you using? I only get the error when using Python 2, no error with Python 3.

ghost avatar Oct 23 '17 13:10 ghost

I am use python3. Is using python 2 mandatory for you ?

RobinDavid avatar Oct 23 '17 22:10 RobinDavid

I am using python 3.

MalcontentLout avatar Oct 24 '17 01:10 MalcontentLout