How to print a unicode string?

damonwischik at gmail.com damonwischik at gmail.com
Fri Apr 18 20:50:40 EDT 2008


On Apr 19, 1:36 am, 7stud <bbxx789_0... at yahoo.com> wrote:
> u_str = u'hell\u00F6 w\u00F6rld'  #o's with umlauts
> print u_str.encode('utf-8')
>
> --output:--
> hellö wörld

Maybe on your system. On my system, those same commands produce
hell\303\266 w\303\266rld

Those \303\266 symbols are single characters -- when I move around
with cursor keys, the cursor jumps across them with a single key-
press.

As I wrote, I'm running Python inside Emacs 22.2.1 (using python-
mode).

Damon.



More information about the Python-list mailing list