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

Does it work for Windows? #2

Open
hlide opened this issue Sep 16, 2023 · 2 comments
Open

Does it work for Windows? #2

hlide opened this issue Sep 16, 2023 · 2 comments

Comments

@hlide
Copy link

hlide commented Sep 16, 2023

========== RESTART: C:\Users\hlide\Documents\Arduino\TZZ80\read_csv.py =========
Traceback (most recent call last):
  File "C:\Users\hlide\Documents\Arduino\TZZ80\read_csv.py", line 193, in <module>
    f.write("{}\n".format(BitfieldASCII.from_dict(
  File "C:\Users\hlide\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 66-130: character maps to <undefined>

Using IDLE.

@hlide
Copy link
Author

hlide commented Sep 16, 2023

It seems the only solution I have is to open the file in UTF-8 mode (generating a .h file). It looks like Windows does not recognize those characters if not generated from UTF-8.

@zegervdv
Copy link
Owner

Right, I hadn’t realized that python on Windows doesn’t handle UTF8 automatically.

According to this article setting PYTHONUTF8=1 might help?

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

No branches or pull requests

2 participants