Skip to content

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

Description

@pedromopi

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions