Ticket #1943 (closed defect: fixed)
[PATCH] __init__.py admi18n encodes utf-8 twice
| Reported by: | jbinney | Owned by: | anonymous |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.x bugfix |
| Component: | Toolbox.admi18n | Version: | 1.0.5 |
| Severity: | major | Keywords: | admi18n translate UnicodeDecodeError |
| Cc: |
Description
The init.py script in <turbogears>/toolbox/admi18n/ calls the google_translate function, which already returns type unicode, and then encodes the unicode again in utf-8. When it passes the text to the catalog.py update function, it appears to be of type str, while it's really a double-encoded unicode. This causes the save function to fail if the text contains any non-ASCII characters. In my patch, I simply remove the unnecessary second utf-8 encode from init.py.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
