Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> I have a string containing Latin-1 characters:
> 
> s = u"© and many more..."
> 
> I want to convert it to HTML entities:
> 
> result =>
> "&copy; and many more..."
[...[
> Is there a "batteries included" solution that doesn't involve
> reinventing the wheel?

recode is good for this kind of things:

    $ recode latin1..html -d mytextfile

It seems that there are recode bindings for Python:

    $ apt-cache search recode | grep python
    python-bibtex - Python interfaces to BibTeX and the GNU Recode library

HTH, cheers.
-- 
Roberto Bonvallet
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to