Changes between Version 5 and Version 6 of TracDev/UnicodeGuidelines
- Timestamp:
- Aug 29, 2006, 9:37:41 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/UnicodeGuidelines
v5 v6 183 183 in this situation. 184 184 185 ''FIXME: talk a bit about the other utilities'' 186 187 ''FIXME: Those utilities are currently placed in the `trac.util` package, 188 though I'm thinking about moving them in the `trac.util.text` package: 189 * ''some of the corresponding unit tests are already in `trac.util.tests.text`'' 190 * ''`to_unicode` could then be used in the `Markup` class'' 185 There are a few other unicode related utilies besides `to_unicode` in the [source:/trunk/trac/util/text.py trac.util.text] module. 191 186 192 187 === The Mimeview component === … … 213 208 * `Mimeview.to_unicode(self, content, mimetype=None, charset=None)` [[br]] 214 209 uses the `to_unicode` utility and eventually guess the charset if needed 215 * ''`Mimeview.is_binary(self, filename, content, mimetype)`'' '''TBD''' [[br]] 216 guess if the `content` is textual data or not 217 210 '''Note that the Mimeview API is currently behing overhauled and will most probably change in the next releases. See #3332'''. 218 211 219 212 == Trac boundaries for Unicode Data == … … 228 221 Each database connector should configure its database driver 229 222 so that the `Cursor` objects are able to accept and will return 230 `unicode` objects. 223 `unicode` objects. This sometimes involve writing a wrapper class 224 for the original Cursor class. See for example 225 [trac/db/sqlite_backend.py@head#L58 SQLiteUnicodeCursor], for pysqlite1. 231 226 232 227 === Filesystem objects === … … 271 266 converted to UTF-8 encoded `str` objects just before being inserted in the "HDF" 272 267 (the data structure used by the template engine to fill in the templates). 273 274 The body of those templates (the `.cs` files) must also use this encoding. 268 This is done automatically by our 269 [source:/trunk/trac/web/clearsilver.py@head#L22 HDFWrapper] class, so anywhere else 270 in the code one can safely associate unicode values to entries in `req.hdf`. 271 272 The body of those templates (the `.cs` files) must also use the UTF-8 encoding. 275 273 276 274 === The Web interface ===