raw_input() and utf-8 formatted chars

7stud bbxx789_05ss at yahoo.com
Sat Oct 13 04:09:46 CEST 2007


On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> You mean literally!?  Then of course I get A\xcc\x88 because that's what I
> entered.  In string literals in source code the backslash has a special
> meaning but `raw_input()` does not "interpret" the input in any way.
>

Then why don't I end up with the same situation as this:

> >> > s = 'A\xcc\x88'   #capital A with umlaut
> >> > print s           #displays capital A with umlaut


> > And what is it that your keyboard enters to produce an 'a' with an umlaut?
>
> *I* just hit the ä key.  The one right next to the ö key.  ;-)
>

...and what if you don't have an a-with-umlaut key?




More information about the Python-list mailing list