DeepDanbooru icon indicating copy to clipboard operation
DeepDanbooru copied to clipboard

Fix cp1252 UnicodeEncodeError

Open NotRel opened this issue 1 year ago • 0 comments

Simple fix for the following UnicodeEncodeError error:

  File "..\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 25-26: character maps to <undefined>

The error occurs when running the script on a file path containing non-ASCII characters, such as Japanese.

To reproduce the error on Windows command line, run the following command:

python -m deepdanbooru evaluate --project-path ./deepdanbooru-v3-20211112-sgd-e28/ "h:\path to\image\やあ.png" >out

NotRel avatar Feb 21 '23 15:02 NotRel