Hi everybody,

I'm trying desperately to get   into some html that I'm transforming,
but must be doing something terribly wrong.

An example:

import kid
kid.Template
(source='<div>&nbsp;</div>').serialize(encoding='utf-8',output='html')
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd";>\n<DIV>\xc2\xa0</DIV>'


Ok, so I didn't expect to see the initial \xc2 portion, and that, in fact,
gives me an A with a hat over it that shows up in my rendered html, which I
definitely do not want.

Using ascii or even iso-8859-1 as the encoding produces &#160; and \xa0
respectively. But my master template needs to have this line in it:

<meta content="text/html; charset=utf-8" http-equiv="content-type"
py:replace="''"/>

So...I need to use a utf-8 encoding. I'm assuming kid is really giving me
what I'm asking for (been doing a bit of research on the ins and outs of
Unicode and encodings. Getting up to speed but still not totally there yet),
so am I asking kid for the wrong thing? What should I be asking for? Or
should I be escaping that &nbsp; with a special escape sequence or something
so that kid doesn't mess with it?

To sum it all up, all I want to do is have an &nbsp; in my kid template and
get back that same &nbsp; in my rendered html.  I must be making this way
too hard?
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to