nathan-sain / foundry-world-tools

A Python CLI for managing Foundry VTT assets on the file system
MIT License
10 stars 5 forks source link

UnicodeDecodeError running in Windows #10

Closed jocolamarco closed 3 years ago

jocolamarco commented 3 years ago

Get the following error when running the tool in Windows:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1162: character maps to <undefined>

EDIT: I was able to workaround this by activating a beta feature in Windows10

nathan-sain commented 3 years ago

@jocolamarco I'm interested to know what feature you enabled in order to get around this error.

Unfortunately, It seems the 0x9d character doesn't have a corresponding entry in the utf-8 character map. I'm curious what format the the file on your system is? If there are other reports of errors related to charmaps I may use the chardet module to attempt to determine the encoding of files before reading from them.

jocolamarco commented 3 years ago

I used notepad++ and sublime console features to check system encoding in win10. It came up as 'undefined'. Then, after some googling, i went into advanced settings and enabled the following:

"Beta: Use Unicode UTF-8 for worldwide language support".

All Settings -> Time & Language -> Language -> "Administrative Language Settings

A domingo, 6/06/2021, 20:18, Nathan Sain @.***> escreveu:

@jocolamarco https://github.com/jocolamarco I'm interested to know what feature you enabled in order to get around this error.

Unfortunately, It seems the 0x9d character doesn't have a corresponding entry in the utf-8 character map. I'm curious what format the the file on your system is? If there are other reports of errors related to charmaps I may use the chardet module to attempt to determine the encoding of files before reading from them.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nathan-sain/foundry-world-tools/issues/10#issuecomment-855448541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZRRR2FKW6VCUT2ICPGW73TRPC2BANCNFSM457IRGVA .

nathan-sain commented 3 years ago

Thanks for the information and your solution. I'm going to close this issue. I'll reopen it if character encoding on Windows continues to be a general problem.