[Twisted-web] Re: Stan and specials chars

Alex Levy mesozoic at polynode.com
Wed Jun 23 11:38:43 MDT 2004


On 6/23/2004, "soft.omicron at laposte.net" <soft.omicron at laposte.net>
wrote:

>How to obtain the following chars with stan : éèçà© for example (I always 
>obtain the ? char)

You'll have to use XML identities, as far as I know. So the Stan would
be:

myStan = tags.div[tags.xml("&copy; 2004 Soft Omicron"]

If you had any characters that needed to be translated into XML, you
would do something like this:

myStan = tags.div[
    "<&&This will render as normal text&>",
    "but this won't: ", tags.xml("&copy;"),
    ]

There may be a way to extend the string renderer so that it detects these
special characters and reformats them, but I think that'd get way too
hairy (given the plethora of different native encodings people use these
days).



More information about the Twisted-web mailing list