Umlauts in idle

Discussion in 'Python' started by a_olme, Dec 12, 2008.

  1. a_olme

    a_olme Guest

    Hello all,

    When I try to use umlauts in idle it will only print out as Unicode
    escape characters. Is it possible to configure idle to print them as
    ordinary characters?

    Best Regards Anders Olme
     
    a_olme, Dec 12, 2008
    #1
    1. Advertising

  2. > When I try to use umlauts in idle it will only print out as Unicode
    > escape characters. Is it possible to configure idle to print them as
    > ordinary characters?


    Did you really use the print statement? They print out fine for me.

    Regards,
    Martin
     
    Martin v. Löwis, Dec 13, 2008
    #2
    1. Advertising

  3. a_olme

    a_olme Guest

    On 13 Dec, 10:38, "Martin v. Löwis" <> wrote:
    > > When I try to use umlauts in idle it will only print out as Unicode
    > > escape characters. Is it possible to configure idle to print them as
    > > ordinary characters?

    >
    > Did you really use the print statement? They print out fine for me.
    >
    > Regards,
    > Martin


    No I just put the characters in quotes like this "öäå"[::-1] and
    pressed return.

    //olme
     
    a_olme, Dec 13, 2008
    #3
  4. On Sat, 13 Dec 2008 02:58:48 -0800, a_olme wrote:

    > On 13 Dec, 10:38, "Martin v. Löwis" <> wrote:
    >> > When I try to use umlauts in idle it will only print out as Unicode
    >> > escape characters. Is it possible to configure idle to print them as
    >> > ordinary characters?

    >>
    >> Did you really use the print statement? They print out fine for me.
    >>
    >> Regards,
    >> Martin

    >
    > No I just put the characters in quotes like this "öäå"[::-1] and pressed
    > return.


    Then you have two problems: First, you don't have unicode characters but
    a bunch of bytes which encode the three characters you've showed above.
    Reversing the bytes might "break" them if your system uses multiple bytes
    to encode one character, e.g. UTF-8, because the order does matter.

    Second, if you don't ``print`` but let the interpreter show the result
    you get the `repr()` form of that character displayed, which always uses
    escapes for bytes that are non-printable or not within the ASCII range
    for strings.

    Ciao,
    Marc 'BlackJack' Rintsch
     
    Marc 'BlackJack' Rintsch, Dec 13, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Axel Dahmen
    Replies:
    3
    Views:
    4,476
    Axel Dahmen
    Apr 30, 2005
  2. John Dalberg
    Replies:
    1
    Views:
    1,903
    Joerg Jooss
    Feb 17, 2006
  3. Replies:
    10
    Views:
    1,029
    Shmuel (Seymour J.) Metz
    Nov 1, 2005
  4. Moritz Beller

    Where have all the umlauts gone?

    Moritz Beller, Nov 7, 2004, in forum: C++
    Replies:
    1
    Views:
    336
    Victor Bazarov
    Nov 7, 2004
  5. Joerg Lehmann

    Print formatted Strings with Umlauts

    Joerg Lehmann, Feb 11, 2004, in forum: Python
    Replies:
    4
    Views:
    397
    Joerg Lehmann
    Feb 12, 2004
Loading...

Share This Page