Edgewall Software

Changes between Version 43 and Version 44 of GenshiFaq


Ignore:
Timestamp:
Mar 1, 2008, 11:51:35 AM (16 years ago)
Author:
martin@…
Comment:

Added missing SQLAlchemy root URL

Legend:

Unmodified
Added
Removed
Modified
  • GenshiFaq

    v43 v44  
    159159Genshi refuses to work with bytestrings that do not use the system default encoding, which on most systems is ASCII. This behavior is by design. If you want to render strings that contain characters outside of the ASCII range (or don't use the system default encoding), you will have to pass `unicode` objects to Genshi.
    160160
    161 This doesn't mean that Genshi has bad support for non-ASCII strings. Quite the contrary -- Genshi works beautifully with unicode. It just requires that you do the decoding of your bytestrings before passing the data to the templates. If this data comes from a database, it's likely that your database connector provides an option to automatically decode any data to unicode. SQLAlchemy, for example, provides a `convert_unicode` flag you can specify when [http://www.sqlalchemy.org/docs/dbengine.html#dbengine_options creating an engine]. Set that flag to `True`, and you get rid of a whole class of potentially nasty problems.
     161This doesn't mean that Genshi has bad support for non-ASCII strings. Quite the contrary -- Genshi works beautifully with unicode. It just requires that you do the decoding of your bytestrings before passing the data to the templates. If this data comes from a database, it's likely that your database connector provides an option to automatically decode any data to unicode. [http://www.sqlalchemy.org/ SQLAlchemy], for example, provides a `convert_unicode` flag you can specify when [http://www.sqlalchemy.org/docs/dbengine.html#dbengine_options creating an engine]. Set that flag to `True`, and you get rid of a whole class of potentially nasty problems.
    162162
    163163For more information on unicode and using unicode in Python applications, see: