Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cohesion crashes when using system-dependent encoding #21

Open
Snezhnaya-chan opened this issue Jan 14, 2025 · 0 comments · May be fixed by #22
Open

cohesion crashes when using system-dependent encoding #21

Snezhnaya-chan opened this issue Jan 14, 2025 · 0 comments · May be fixed by #22

Comments

@Snezhnaya-chan
Copy link

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.

@Snezhnaya-chan Snezhnaya-chan linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant