excalibur icon indicating copy to clipboard operation
excalibur copied to clipboard

'ascii' codec can't encode character

Open domints opened this issue 5 years ago • 2 comments

I tried to convert some tables in Polish govt doc, containing polish accented characters. This failed with error: UnicodeEncodeError: 'ascii' codec can't encode character u'\u015a' in position 346: ordinal not in range(128) The character in question is ś, but there are way more such characters in that file.

If I need something reconfigured to be able to parse such chars, I believe it shouldn't raise an error, but rather suggest change :)

I can share the file if needed :)

domints avatar May 13 '19 16:05 domints

Same here with ä :

ERROR:root:'ascii' codec can't encode character u'\xe4' in position 258: ordinal not in range(128)
Traceback (most recent call last):
  File "/home/maurus/.local/lib/python2.7/site-packages/excalibur/tasks.py", line 123, in extract  tables.export(f_datapath, f=f, compress=True)
  File "/home/maurus/.local/lib/python2.7/site-packages/camelot/core.py", line 701, in export  self._write_file(f=f, **kwargs)
  File "/home/maurus/.local/lib/python2.7/site-packages/camelot/core.py", line 659, in _write_file    to_format(filepath)
  File "/home/maurus/.local/lib/python2.7/site-packages/camelot/core.py", line 594, in to_html   f.write(html_string)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 258: ordinal not in range(128)

mausquirk avatar Jul 03 '19 09:07 mausquirk

Same here. Try to run under Python3. It works for me.

gilbertoloio avatar Aug 28 '19 14:08 gilbertoloio