I have an MSSQL database with data stored in Hungarian charset.
I've tried to use the DataTables example from here:
http://www.web2pyslices.com/slice/show/2052/using-datatablesnet-with-web2py-for-ultra-fast-grid-display
but I'v got this error.
UnicodeDecodeError: 'utf8' codec can't decode byte 0xed in position 14: invalid
continuation byte
The database request went well, I can see the returned data although
already unicode encoded in the error ticket.
Here is the beginning of the returned data where you can see the accented
character escapes : ((self=<json.encoder.JSONEncoder object>,
o=[{'ARAMNEM_NEV': 'nincs villamos\xedtva', ....)
The view is almost exactly the same as in the link of slice above.
Controller:
def index():
import json
res = json.dumps(db.executesql('select * from bd_aramnemek', as_dict =
True))
return dict(results=XML(res))
What should I do to get back the native chars stored in the DB?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.