UnicodeEncodeError on Windows due to missing encoding="utf-8"
pedromopi opened this issue · 0 comments
pedromopi commented
ktool/src/ktool/ktool_script.py
Line 956 in 2e48516
Encountered a UnicodeEncodeError on Windows when attempting to write Unicode characters to a file. The error message is: UnicodeEncodeError: 'charmap' codec can't encode character '\u0441' in position 2360: character maps to . This issue occurs because the file is being opened with the default encoding (which does not support certain Unicode characters). To resolve this, specifying encoding='utf-8' when opening the file is recommended to support all Unicode characters.
+ with open(args.outdir + '/' + header_name, 'w', encoding="utf-8") as out: