Python and UTF-8

Brandvik tmagna at online.no
Wed Jan 2 08:01:01 EST 2002


I'm making a small automated managing system for my website and I
think I will go for Python and CGI. I have one question though: my
website is in Norwegian and in valid XHTML. All characters need to be
encoded in UTF-8. The way I'm currently doing it is that all articles
go through me for formatting and validation. When switching to a CMS
everybody with access to the system will be able to put articles on my
website and this means that all kinds of formatting will be used. This
will make the W3C validator choke and my site would not validate. 

Is it possible to make a python script that would change the character
to UTF-8 no matter what the encoding of the input is? I have heard
that Python has some great functions for Unicode formatting so this
might be an easy and trivial task, but I'm new to Python so I really
don't know...

-Brandvik



More information about the Python-list mailing list