Converting foreign characters to HTML characters entities

Charlie Clark charlie at begeistert.org
Mon May 28 10:26:32 EDT 2001


Lutz Schroeer wrote:
>
> My program reads strings out of a database and converts them to an
> HTML-
> page. The string contains German Umlauts which I would like to convert
> to
> HTML character entities.
>
> Is there any simple method to do this without explicitly writing a
> function
> by myself? Are there any standard modules which I didn't find or any
> third
> party objects?
>
You could try using the CODECs for this. I'm not a wizz at the syntax
but I did manage to get it to work for something similar.

Charlie



More information about the Python-list mailing list