Compressed string : xsÊÏS(KÍ+9´@±Æ9± ³$13/UÁ#39»¸¦4/;/¿<¯&7µ¸81=§ð{±◄ Got error :…
- User
Compressed string : xsÊÏS(KÍ+9´@±Æ9± ³$13/UÁ#39»¸¦4/;/¿<¯&7µ¸81=§ð{±◄
Got error : Exception has occurred: ValueError string argument should contain only ASCII characters UnicodeEncodeError: 'ascii' codec can't encode character '\x9c' in position 1: ordinal not in range(128)
During handling of the above exception, another exception occurred:
File "C:\Users\Brahim\Desktop\Python\WoW\TTS\qr-detect.py", line 29, in process_qrcode_data compressed_data = base64.b64decode(text) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Brahim\Desktop\Python\WoW\TTS\qr-detect.py", line 108, in test_qr_detection_tts text_to_read, npc_name, npc_sex, query_type = self.process_qrcode_data(qr_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Brahim\Desktop\Python\WoW\TTS\qr-detect.py", line 149, in asyncio.run(qr_detector.test_qr_detection_tts()) ValueError: string argument should contain only ASCII characters
- Assistant
The error you are encountering is indicating that the function is being passed a string that contains non-ASCII characters. Base64 encoding is designed for ASCII characters, and trying to pass characters outside of the ASCII range (characters with ordinal values greater than 127) will cause problems with Python’s default handling that expects ASCII encoding.