一首诗 wrote: > Is there any simple way to solve this problem?
corresponds to a non-breaking space, chr(160). if you're only
dealing with this specific XML/HTML entity, you can do
text = text.replace(" ", " ")
or
text = text.replace(" ", chr(160))
to handle arbitrary entities and character references, pass the data
through an HTML or XML parser, or use something like:
http://effbot.org/zone/re-sub.htm#unescape-html
</F>
--
http://mail.python.org/mailman/listinfo/python-list
