epwing2kindle icon indicating copy to clipboard operation
epwing2kindle copied to clipboard

UnicodeEncodeError when converting to opf

Open Zorbet opened this issue 5 years ago • 0 comments

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.

Zorbet avatar May 27 '19 04:05 Zorbet