You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 togetattr
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 theBaseDaaset()._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:
I'm sure that you can test with any accentuated character :).
[]'s
The text was updated successfully, but these errors were encountered: