Umlauts in idle

A

a_olme

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
 
M

Martin v. Löwis

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
 
A

a_olme

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
 
M

Marc 'BlackJack' Rintsch

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top