acentuation problem

  • Thread starter =?iso-8859-1?Q?Mauricio_Infor=E7ati?=
  • Start date
?

=?iso-8859-1?Q?Mauricio_Infor=E7ati?=

Hi,
I am having problems with acentuation on python.
Before, I used to have win98 with python 2.2.3. Everything worked perfectly.
Now, I´ve updated my OS to Windows 2000 and have problems.
When I try to save on IDLE a script wich has portuguese acentuation on some strings (like "andré"), it desn´t let me save the file, with this error.

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python22\lib\lib-tk\Tkinter.py", line 1316, in __call__
return apply(self.func, args)
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 128, in save
if self.writefile(self.filename):
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 151, in writefile
chars = str(self.text.get("1.0", "end-1c"))
UnicodeError: ASCII encoding error: ordinal not in range(128)

Similarly, on SHELL I can not use acentuation either.
[shell]
BUT, in a command line python, on the same OS, I can use acentuation normally, without using unicodes or escape characters.
[command line]

Can anybody help me?

Maurício Inforçati
 
B

Bengt Richter

This is a multi-part message in MIME format.
Please try to post only plain text to newsgroups.
[...]
Hi,
I am having problems with acentuation on python.
Before, I used to have win98 with python 2.2.3. Everything worked =
perfectly.
Now, I=B4ve updated my OS to Windows 2000 and have problems.
When I try to save on IDLE a script wich has portuguese acentuation on =
some strings (like "andr=E9"), it desn=B4t let me save the file, with =
this error.

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python22\lib\lib-tk\Tkinter.py", line 1316, in __call__
return apply(self.func, args)
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 128, in save
if self.writefile(self.filename):
File "C:\PYTHON22\Tools\idle\IOBinding.py", line 151, in writefile
chars =3D str(self.text.get("1.0", "end-1c"))
UnicodeError: ASCII encoding error: ordinal not in range(128)

Similarly, on SHELL I can not use acentuation either.
[shell]
BUT, in a command line python, on the same OS, I can use acentuation =
normally, without using unicodes or escape characters.
[command line]

Can anybody help me?
Perhaps the encoding set in control panel>keyboard>input locales>properties is
not Portuguese?

The code page for the console window is separately (I believe) controlled with
the chcp command, which tells you the current code page number if you type chcp
without specifying anything.

Between that number and what you can see in your location for
D:\Python23\Lib\encodings\aliases.py, maybe you can figure out why one works
and the other doesn't.

Caveat: I haven't changed my control panel keyboard settings, so I don't know
if you have to reboot for it to take effect, or what else gets affected.

Martin Löwis is the guru on encodings (among other things).
Maur=EDcio Infor=E7ati


------=_NextPart_000_01D4_01C360C9.9B611630
Content-Type: text/html;
charset="iso-8859-1"
[...please don't post html if you can avoid it...]

Regards,
Bengt Richter
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top