Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

UnicodeEncodeError #16

Open
simonpa71 opened this issue Mar 28, 2014 · 1 comment
Open

UnicodeEncodeError #16

simonpa71 opened this issue Mar 28, 2014 · 1 comment

Comments

@simonpa71
Copy link

I am using tablefu + jinja2 to create html forms from an excel spreadsheet. Excel 2013 will export csv with 8bit ASCII, Latin-1, which allows for translations into European languages.
Tablefu is based on the csv reader that does not natively support >128 ASCII or unicode, and jinja only wants unicode, so I get UnicodeEncodeError.
However the help page http://docs.python.org/2/library/csv.html#examples does have an implemention for unicode.
I pasted the example generator into init.py and added an "encoding" option, to replace reader = unicode_csv_reader, replaced open with codecs.open, et voilà, my tables and html can contain Latin-1.

@eyeseast
Copy link
Owner

Thanks for the heads up. Care to package this fix into a pull request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants