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

UnicodeEncodeError when converting to opf #3

Open
Zorbet opened this issue May 27, 2019 · 0 comments
Open

UnicodeEncodeError when converting to opf #3

Zorbet opened this issue May 27, 2019 · 0 comments

Comments

@Zorbet
Copy link

Zorbet commented May 27, 2019

The Tab to Opf conversion step does not create a file when running the standard tool, and the japanese-specific tool gives a UnicodeEncodeError.

Standard Tool

Reading keys: 534710keys [00:04, 125764.89keys/s]
Writing html: 43files [00:04,  8.96files/s]
Writing opf:

Japanese-Specific

Reading keys
Writing keys
Traceback (most recent call last):
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 329, in <module>
    ndicts = writekeys(defns, name)
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 252, in writekeys
    writekey(to, key, defns[key])
  File "D:\grant\Downloads\epwing2kindle-master\tab2opf-master\tab2opf.py", line 229, in writekey
    to.write('; '.join(ndefn for _, ndefn, _ in g))
  File "C:\Python\Python36-32\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 2-9: character maps to <undefined>

I looked into the closed issue that covered a similar problem, but it didn't seem to be applicable to this one. I tried with a different dictionary and it gave me a unicode error as well.

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

1 participant