Discussion:
  replaced by 0xa0 in the output
flobro30101
2014-04-03 14:33:14 UTC
Permalink
So the output displays as something other than a space character. I have
the encodeing set in python to utf-8.
See template below.


Using python 2.7 on Fedora 19
Genshi 0.7-3


Thanks for pointing out my missing something.



<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
<br clear="all"/>
<table border="0" width="100%">
<tbody><tr><td>nobody</td></tr>
<tr><td>nowhere</td></tr>
<tr><td>anytown, usa</td></tr>
</tbody>
</table>

<br/><br/><br/><br/><br/><br/><br/>

<table border="0" width="100%">
<tbody><tr><td>${name}</td></tr>
<tr><td>${addr1}</td></tr>
<tr><td>${addr2}</td></tr>
<tr><td>${city},${state}&nbsp;${zip}</td></tr>
</tbody>
</table>
<hr style="border-style: dashed;" />
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
Simon Cross
2014-04-03 20:11:22 UTC
Permalink
Hello!
from genshi.input import XML
XML("<p>&nbsp;</p>").render()
u'<p>\xa0</p>'

You'll see that Genshi turns &nbsp; into \xa0 -- the Unicode
non-breaking space character
(http://en.wikipedia.org/wiki/Non-breaking_space).

Hope that clarifies things!

Schiavo
Simon
--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genshi+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/genshi.
For more options, visit https://groups.google.com/d/optout.
Loading...