jfarley248 / iTunes_Backup_Reader

Python 3 Script to parse out iTunes backups
MIT License
172 stars 41 forks source link

UnicodeEncodeError: 'charmap' codec can't encode character '\u043e' in position 37: character maps to <undefined> #8

Open omhmega opened 4 years ago

omhmega commented 4 years ago

Python 3.6.3 and 3.8.3 on Windows 10. Unencrypted backup. -i, -o, -v, -t txt parameters This Python Unicode issue was supposed to be fixed in versions 3.6+.

After deleting the kaitaistruct import line, now the script fails on Unicode character '\u043e' which is cyrillic small letter o

06-23 11:39 root DEBUG Found user's name from SINF: XXXXXXXXXXXXXXXX 06-23 11:39 root DEBUG Found magic name in SINF 06-23 11:39 root DEBUG Found user's name from SINF: XXXXXXXXXXXXXXXX 06-23 11:39 root DEBUG Data being interpreted for FRPD is of type: <class 'bytes'> 06-23 11:39 root DEBUG Found magic bytes in iTunes Prefs FRPD... Finding Usernames and Desktop names now 06-23 11:39 root DEBUG Starting output to I:\on-1\Device_YYYYYYYYYYY_Output.txt 06-23 11:39 root ERROR Could not write output to I:\on-1\Device_YYYYYYYYYYY_Output.txt Exception was: 'charmap' codec can't encode character '\u043e' in position 37: character maps to Traceback (most recent call last): File "C:\temp\iTunes_Backup_Reader-4.0\helpers\writer.py", line 152, in startWrite writeToTxt(backup_list, application_list, output_file, logger) File "C:\temp\iTunes_Backup_Reader-4.0\helpers\writer.py", line 45, in writeToTxt "iTunes Version: \t" + backup_list[17] + "\n\n") File "C:\Program Files\Python36\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u043e' in position 37: character maps to 06-23 11:39 root INFO Program ended in: 1.6166751384735107 seconds

jfarley248 commented 3 years ago

Hello, looking at you rother comments, I assume this is no longer an issue? If so could you describe what you found the solution to be? If not let me know as well, thanks

omhmega commented 3 years ago

Hi, sorry for the late reply. I've deleted that file on my phone before doing a new backup. After that the Backup Reader worked. Not a perfect solution, but I was trying to reduce the size of my backups anyway. Thanks