Edgewall Software

Opened 10 years ago

Closed 10 years ago

#224 closed defect (duplicate)

escape() function doesn't handle non-ASCII text

Reported by: kovid@… Owned by: cmlenz
Priority: major Milestone:
Component: Template processing Version: 0.4.4
Keywords: Cc:


The escape function in core.py raises a UnicodeDecodeError? when passed a non-ascii string. Instead it should either not convert to unicode or use 'replace' error handling. See the traceback in http://calibre.kovidgoyal.net/ticket/650 for an example of an error caused by this behavior.

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by cmlenz

  • Component changed from General to Template processing
  • Milestone 0.5 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Genshi expects you to use unicode objects for non-ASCII strings. While there's a chance it'll assume UTF-8 by default in the future, it'll continue to do strict error handling. And there's simply no way to do proper character data processing based on bytestrings of arbitrary encoding.

See also #184.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.