thisisparker / xword-dl

⬛⬜⬛ Command line tool to scrape crosswords from online solvers and save them as .puz files ⬛⬜⬛
MIT License
145 stars 31 forks source link

Explicitly define encoding as utf-8 #117

Closed ehcloninger closed 1 year ago

ehcloninger commented 1 year ago

Working toward solving #115

On Windows 11, using Powershell, VS Code, and Python 3.11.5. Ran into exceptions into setup.py while playing around. On windows, open() defaults to cp1252 instead of utf-8. :-( Just starting with the project and this was the first thing I encountered. I suspect @thisisparker uses Mac or Linux.

ehcloninger commented 1 year ago

If I misunderstand this, feel free to reject. I'm a C/C++ dev and more than a bit rusty.

thisisparker commented 1 year ago

Guilty as charged! I guess open() uses whatever locale.getencoding() returns. Oddly we do use roughly 1252 throughout a lot of the project because of .puz limitations, but you're right it should be utf-8 here. Thanks for the PR!

ehcloninger commented 1 year ago

Guilty as charged! I guess open() uses whatever locale.getencoding() returns. Oddly we do use roughly 1252 throughout a lot of the project because of .puz limitations, but you're right it should be utf-8 here. Thanks for the PR!

No worries. I'm platform agnostic. I use Windows, Mac, and Linux. Whatever works best. I blew the dust off my 2014 Macbook to maybe make it easier.