RobinDavid/LSB-Steganography

UnicodeDecodeError

MalcontentLout opened this issue · 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.

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

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

I am using python 3.