Skip to content

cohesion crashes when using system-dependent encoding #21

Description

@itzexpoexpo

Currently cohesion uses the default encoding for open():

with open(filename) as fd:
return fd.read()

This takes the encoding from locale.getpreferredencoding(), which on my Windows installation is cp1252. So even though my file is saved in UTF-8, cohesion loads it in cp1252, crashing with
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 9011: character maps to <undefined>

Adding encoding="utf-8" would solve this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions