Edgewall Software

Ticket #224 (closed defect: duplicate)

Opened 6 years ago

Last modified 6 years ago

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:

Description

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

Change History

Changed 6 years ago by cmlenz

  • status changed from new to closed
  • resolution set to duplicate
  • component changed from General to Template processing
  • milestone 0.5 deleted

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/Change #224 (escape() function doesn't handle non-ASCII text)

Author


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


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.