Re: Unicode, command-line and idle

2006-04-14 Thread Kent Johnson
Egon Frerich wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > What do you have in the IDLE options - General - Default source encoding? UTF-8 > > Egon > > Kent Johnson schrieb am 12.04.2006 12:40: > >> [EMAIL PROTECTED] wrote: >>> Hello again, I've investigated a little bit and th

Re: Unicode, command-line and idle

2006-04-12 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What do you have in the IDLE options - General - Default source encoding? Egon Kent Johnson schrieb am 12.04.2006 12:40: > [EMAIL PROTECTED] wrote: >> Hello again, I've investigated a little bit and this is what I found: >> >> If I run IDLE and type

Re: Unicode, command-line and idle

2006-04-12 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hello again, I've investigated a little bit and this is what I found: > > If I run IDLE and type > import sys sys.stdin.encoding > > I get > > 'cp1252' > > But if I have a whatever.py file (it can even be a blank file), I edit > it with IDLE, I press F5 (Ru

Re: Unicode, command-line and idle

2006-04-11 Thread a . serrano
Hello again, I've investigated a little bit and this is what I found: If I run IDLE and type >>> import sys >>> sys.stdin.encoding I get 'cp1252' But if I have a whatever.py file (it can even be a blank file), I edit it with IDLE, I press F5 (Run Module) and then type: >>> import sys >>> sys.

Re: Unicode, command-line and idle

2006-04-07 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Martin v. Löwis wrote: >> [EMAIL PROTECTED] wrote: >>> This works if I use the console but gives the following error if I use >>> IDLE: >>> >>> Traceback (most recent call last): >>> File "C:\test.py", line 4, in ? >>> text2 = unicode(raw_input(), sys.stdin.encoding

Re: Unicode, command-line and idle

2006-04-06 Thread a . serrano
Martin v. Löwis wrote: > [EMAIL PROTECTED] wrote: > > This works if I use the console but gives the following error if I use > > IDLE: > > > > Traceback (most recent call last): > > File "C:\test.py", line 4, in ? > > text2 = unicode(raw_input(), sys.stdin.encoding) > > AttributeError: PyShe

Re: Unicode, command-line and idle

2006-04-06 Thread John Machin
The docs say that the encoding attribute is "New in version 2.3". Python 2.2's IDLE produces exactly the exception reported by the OP. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode, command-line and idle

2006-04-06 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > This works if I use the console but gives the following error if I use > IDLE: > > Traceback (most recent call last): > File "C:\test.py", line 4, in ? > text2 = unicode(raw_input(), sys.stdin.encoding) > AttributeError: PyShell instance has no attribute 'encoding'

Re: Unicode, command-line and idle

2006-04-06 Thread a . serrano
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Hello, the following program prompts the user for a word and tests to > > see if it is the same as another one. If the user types "españa" (note > > that the word contains an 'ñ'), the program should output "same". This > > works if I run the co

Re: Unicode, command-line and idle

2006-04-06 Thread M�ta-MCI
(just for confirm) Hi! if the console is in cp1252, raw_input work OK with "ñ" This (your) script : # -*- coding: cp1252 -*- import sys text1 = u'españa' text2 = unicode(raw_input(), sys.stdin.encoding) if text1 == text2: print 'same' else: print 'not same' work OK with "chcp 8

Re: Unicode, command-line and idle

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Hello, the following program prompts the user for a word and tests to > see if it is the same as another one. If the user types "españa" (note > that the word contains an 'ñ'), the program should output "same". This > works if I run the code in IDLE but does not if I run