Edgewall Software

Changeset 1144


Ignore:
Timestamp:
Nov 26, 2010, 7:13:21 PM (13 years ago)
Author:
hodgestar
Message:

Add documentation on upgrading to the Genshi py3k branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/experimental/py3k/doc/upgrade.txt

    r1106 r1144  
    77   :depth: 2
    88.. sectnum::
     9
     10----------------------------------------------
     11Upgrading from Genshi 0.6.x to the py3k branch
     12----------------------------------------------
     13
     14The most noticable API change in the Genshi py3k branch is that the
     15default encoding in numerous places is now None (i.e. unicode) instead
     16of UTF-8. This change was made in order to ease the transition to Python 3
     17where strings are unicode strings by default.
     18
     19If your application relies on the default UTF-8 encoding a simple way to
     20have it work both with Genshi 0.6.x and the py3k branch is to specify the
     21encoding explicitly in calls to the following classes, methods and functions:
     22
     23* genshi.HTML
     24* genshi.Stream.render
     25* genshi.input.HTMLParser
     26* genshi.template.MarkupTemplate
     27* genshi.template.TemplateLoader
     28* genshi.template.TextTemplate (and genshi.template.NewTextTemplate)
     29* genshi.template.OldTextTemplate
     30
     31Whether you explicitly specify UTF-8 or explicitly specify None (unicode) is
     32a matter of personal taste, although working with unicode may make porting
     33your own application to Python 3 easier.
    934
    1035
Note: See TracChangeset for help on using the changeset viewer.