Mercurial > genshi > genshi-test
comparison doc/upgrade.txt @ 936:47c83fbdf4d4
Merge r1144 from py3k: Add documentation on upgrading to the Genshi py3k branch.
author | hodgestar |
---|---|
date | Fri, 18 Mar 2011 09:18:59 +0000 |
parents | 0849dcc8ed46 |
children | 459e1fed2c92 |
comparison
equal
deleted
inserted
replaced
935:705727288d7e | 936:47c83fbdf4d4 |
---|---|
4 | 4 |
5 | 5 |
6 .. contents:: Contents | 6 .. contents:: Contents |
7 :depth: 2 | 7 :depth: 2 |
8 .. sectnum:: | 8 .. sectnum:: |
9 | |
10 ---------------------------------------------- | |
11 Upgrading from Genshi 0.6.x to the py3k branch | |
12 ---------------------------------------------- | |
13 | |
14 The most noticable API change in the Genshi py3k branch is that the | |
15 default encoding in numerous places is now None (i.e. unicode) instead | |
16 of UTF-8. This change was made in order to ease the transition to Python 3 | |
17 where strings are unicode strings by default. | |
18 | |
19 If your application relies on the default UTF-8 encoding a simple way to | |
20 have it work both with Genshi 0.6.x and the py3k branch is to specify the | |
21 encoding 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 | |
31 Whether you explicitly specify UTF-8 or explicitly specify None (unicode) is | |
32 a matter of personal taste, although working with unicode may make porting | |
33 your own application to Python 3 easier. | |
9 | 34 |
10 | 35 |
11 ------------------------------------ | 36 ------------------------------------ |
12 Upgrading from Genshi 0.5.x to 0.6.x | 37 Upgrading from Genshi 0.5.x to 0.6.x |
13 ------------------------------------ | 38 ------------------------------------ |