acentuation problem

Discussion in 'Python' started by =?iso-8859-1?Q?Mauricio_Infor=E7ati?=, Aug 12, 2003.

  1. 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]
    >>> a = 'andré'

    UnicodeError: ASCII encoding error: ordinal not in range(128)
    >>>


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

    >>> a = 'andré'
    >>>


    Can anybody help me?

    Maurício Inforçati
     
    =?iso-8859-1?Q?Mauricio_Infor=E7ati?=, Aug 12, 2003
    #1
    1. Advertising

  2. On Tue, 12 Aug 2003 12:02:30 -0300, =?iso-8859-1?Q?Mauricio_Infor=E7ati?= <> wrote:

    >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]
    >>>> a =3D 'andr=E9'

    >UnicodeError: ASCII encoding error: ordinal not in range(128)
    >>>>=20

    >
    >BUT, in a command line python, on the same OS, I can use acentuation =
    >normally, without using unicodes or escape characters.
    >[command line]
    >
    >>>> a =3D 'andr=E9'
    >>>>

    >
    >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
     
    Bengt Richter, Aug 12, 2003
    #2
    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. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,989
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,166
    Ted Miller
    Sep 13, 2003
  3. Merek
    Replies:
    0
    Views:
    1,971
    Merek
    Dec 3, 2003
  4. Scott Meddows
    Replies:
    1
    Views:
    400
    John Saunders
    Jun 8, 2004
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    552
    Bullschmidt
    May 11, 2004
Loading...

Share This Page