On 9/12/07, Christopher Lenz <[EMAIL PROTECTED]> wrote:
> Am 11.09.2007 um 19:34 schrieb Christoph Zwerschke:
> > Hi Yuan,
> >> I want to have kid output the following HTML code:
> >>
> >> <span>© 2007 ... </span>
> >>
> >> If I write this directly in the template file, the entity © will
> >> be translated to \xa9 in the output.
> >
> > Usually, this is what you want as output; it's completly equivalent to
> > the above.
>
> Agreed, and have to ask: why on earth would that *not* be what you want?
>
Unfortunately they are not completely equivalent :-(
I have to use the encoding 'gbk' for the output, which doesn't have a
corresponding character for \xa9. Trying to convert will raise an
exception. Using encoding 'gbk' in the serialize function will
truncate the simple and all Chinese characters after '2007'.
That's why I have to put © literally in the HTML file. I tried using:
template.serialize(encoding='gbk', fragment=True, output='xml', format='named'))
The © is output as desired. But all Chinese character after it is
truncated.
I tried using encoding='utf8' and then convert the result to gbk. But
with 'utf8' encoding the format='named' argument doesn't seem to be
working and I got \xa0 for , which also is not convertible to
'gbk'
Any suggestions?
--
Hong Yuan
大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss