[Python-3000] Does Py3k's print offer any unicode encoding help?

skip at pobox.com skip at pobox.com
Fri Feb 15 02:02:11 CET 2008


    Guido> You can hack around this for now by doing (before printing
    Guido> anything)

    Guido>   sys.stdout._encoding = 'utf-8'

    Guido> but that ought to be a temporary hack until we've figured out the
    Guido> right way to set it.

How about being able to reopen() an open file object, e.g.:

    print(..., file=sys.stdout.reopen(encoding="utf-8")

?

Skip


More information about the Python-3000 mailing list