Re: Umlauts in idle

2008-12-13 Thread Marc 'BlackJack' Rintsch
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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Umlauts in idle

2008-12-13 Thread a_olme
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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Umlauts in idle

2008-12-13 Thread 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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Umlauts in idle

2008-12-12 Thread Benjamin Kaplan
On Fri, Dec 12, 2008 at 3:51 PM, a_olme  wrote:

> 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



Make sure you are using Unicode strings and not byte strings. This is why
Python 3 switched to using Unicode by default.

IDLE 2.6.1 on Mac 10.5 :

>>> print u'\u00c4'
Ä
>>> print '\u00c4'
\u00c4


>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list


Umlauts in idle

2008-12-12 Thread 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
--
http://mail.python.org/mailman/listinfo/python-list