jipegit / OSXAuditor

OS X Auditor is a free Mac OS X computer forensics tool
Other
3.13k stars 280 forks source link

print should plan on UTF-8 by default #51

Open grogsaxle opened 7 years ago

grogsaxle commented 7 years ago

Had this error:

[INFO] notbob's LoginItems
[INFO] /Users/notbob/Library/Preferences/com.apple.loginitems.plist
Traceback (most recent call last):
  File "osxauditor.py", line 1700, in <module>
    Main()
  File "osxauditor.py", line 1655, in Main
    ParseStartup()
  File "osxauditor.py", line 534, in ParseStartup
    PrintAndLog(CustomListItem['Name'].decode('utf-8') + u' - ' + binascii.hexlify(CustomListItem['Alias']).decode('hex').decode('utf-8', 'ignore'), 'INFO')
  File "osxauditor.py", line 230, in PrintAndLog
    print(u'[INFO] ' + LogStr)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0438' in position 51: ordinal not in range(128)

Would probably rework to not use print, but this is at least handles getting past the above error.