Chapter 20.2.2. Kid Templates

When you you use Unicode strings with Kid everything usually “just works.”

TurboGears uses the _kid.encoding_ configuration option, which defaults to UTF-8 to automatically encode Kid HTML/XML output. The same option is used to set the “Content-Type” HTTP header so that the browser will display it correctly.

One pitfall to watch for is Kid file encoding. Just like any other XML file, the encoding is typically declared in the XML header line of your Kid file. Make sure that the declared encoding matches the actual file content. If the header line and file content don’t match, you might get strange “input file not well-formed” error messages from Kid even though the file is okay, just saved with the ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.