decoding XML-ified special chars such as "

David LeBlanc whisper at oz.net
Mon Jul 29 15:43:23 EDT 2002


> Is there a module to take strings such as ", & and turn them
> into the characters they normally represent (', &)?
>
> Gabe Newcomb
> Software Test Automation Engineer
> 425.372.2732
> Noetix Corporation
> www.noetix.com
>

Well, those are called character entities and those fall under the pervue of
HTML or XML. Sorry I can't be more specific, but you should be able to find
something to deal with those in one of the distributed with python xml libs
or PyXML.

It's also trivially easy to just do this with a dict and the re module.

Dave LeBlanc





More information about the Python-list mailing list