Opened 17 years ago
Closed 17 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: |
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.
Change History (1)
comment:1 Changed 17 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
Note: See
TracTickets for help on using
tickets.
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.