Skip to content

Conversation

@NotRel
Copy link

@NotRel NotRel commented Feb 21, 2023

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

Simple fix for the following `UnicodeEncodeError` error:
```bash
  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:
```bash
python -m deepdanbooru evaluate --project-path ./deepdanbooru-v3-20211112-sgd-e28/ "h:\path to\image\やあ.png" >out
```
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 this pull request may close these issues.

1 participant