Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1943 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

[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


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.


__init__.patch Download (414 bytes) - added by jbinney 11 years ago.

Change History

Changed 11 years ago by jbinney

comment:1 Changed 11 years ago by kskuhlman

  • Status changed from new to closed
  • Resolution set to fixed

Looks good. Applied in r5167. Thanks for the patch!

Note: See TracTickets for help on using tickets.