encoding

Gandalf goldnery at gmail.com
Tue Sep 2 00:11:01 CEST 2008


On Sep 1, 11:59 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Gandalf schrieb:
>
> > if i want to print utf-8 string i should writre:
>
> > print u"hello word"
>
> No, you don't. You write
>
> print u"hello world".encode("utf-8")
>
> Read this:
>
> http://www.reportlab.com/i18n/python_unicode_tutorial.html
>
> > but what happen if i want to print variable?
>
> Then you do
>
> print variable_containing_unicode_object.encode("utf-8")
>
> Diez

thanks



More information about the Python-list mailing list