0cyn/ktool

UnicodeEncodeError on Windows due to missing encoding="utf-8"

Opened this issue · 0 comments

with open(args.outdir + '/' + header_name, 'w') as out:

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: