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

UnicodeDecodeError #43

Open
chronossc opened this issue Jan 30, 2015 · 0 comments
Open

UnicodeDecodeError #43

chronossc opened this issue Jan 30, 2015 · 0 comments

Comments

@chronossc
Copy link

Hello @joshourisman . Thx for django-tablib :).

I'm getting an UnicodeDecodeError when generating HTML table. I have hacked a bit and here is what I found.

On https://github.com/joshourisman/django-tablib/blob/master/django_tablib/views.py#L20 when using hasattr you hide any exception that can happen in rendering of table, if you change to getattr this exceptions raise to developer. It's better to know where the problem of getting a 404 is :]. However, isn't better just keep a suported formats list or is intentional to render at this time?

After I have changed that line to use getattr I finally saw that at https://github.com/joshourisman/django-tablib/blob/master/django_tablib/base.py#L40 the BaseDaaset()._cleanval(value, str) encode the value in 'utf-8'. This is working for XLS an CSV tables, but not for HTML. I have checked that this value is unicode when enter in _cleanval method.

The data that is giving me headcache for you use in tests is:

Rua Maracá
Ap 4231

I'm sure that you can test with any accentuated character :).

[]'s

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