the official way of printing unicode strings

Piotr Sobolewski NIE_DZIALA at gazeta.pl
Sun Dec 14 05:16:56 EST 2008


Marc 'BlackJack' Rintsch wrote:

> I'd make that first line:
> sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
> 
> Why is it even more cumbersome to execute that line *once* instead
> encoding at every ``print`` statement?

Oh, maybe it's not cumbersome, but a little bit strange - but sure, I can
get used to it. 

My main problem is that when I use some language I want to use it the way it
is supposed to be used. Usually doing like that saves many problems.
Especially in Python, where there is one official way to do any elementary
task. And I just want to know what is the normal, official way of printing
unicode strings. I mean, the question is not "how can I print the unicode
string" but "how the creators of the language suppose me to print the
unicode string". I couldn't find an answer to this question in docs, so I
hope somebody here knows it.

So, is it _the_ python way of printing unicode?





More information about the Python-list mailing list