Edgewall Software

Changes between Version 5 and Version 6 of TracDev/UnicodeGuidelines


Ignore:
Timestamp:
Aug 29, 2006, 9:37:41 AM (18 years ago)
Author:
Christian Boos
Comment:

Some updates concerning trac.util.text and several links to examples in the code added. Also added a caveat about the Mimeview API future changes.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/UnicodeGuidelines

    v5 v6  
    183183   in this situation.
    184184
    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''
     185There are a few other unicode related utilies besides `to_unicode` in the [source:/trunk/trac/util/text.py trac.util.text] module.
    191186
    192187=== The Mimeview component ===
     
    213208 * `Mimeview.to_unicode(self, content, mimetype=None, charset=None)` [[br]]
    214209   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'''.
    218211
    219212== Trac boundaries for Unicode Data ==
     
    228221Each database connector should configure its database driver
    229222so that the `Cursor` objects are able to accept and will return
    230 `unicode` objects.
     223`unicode` objects. This sometimes involve writing a wrapper class
     224for the original Cursor class. See for example
     225[trac/db/sqlite_backend.py@head#L58 SQLiteUnicodeCursor], for pysqlite1.
    231226
    232227=== Filesystem objects ===
     
    271266converted to UTF-8 encoded `str` objects just before being inserted in the "HDF"
    272267(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.
     268This is done automatically by our
     269[source:/trunk/trac/web/clearsilver.py@head#L22 HDFWrapper] class, so anywhere else
     270in the code one can safely associate unicode values to entries in `req.hdf`.
     271
     272The body of those templates (the `.cs` files) must also use the UTF-8 encoding.
    275273
    276274=== The Web interface ===