[Idle-dev] [ idlefork-Bugs-778547 ] UTF-8 mode files won't save with non-ASCII characters

SourceForge.net noreply@sourceforge.net
Thu, 31 Jul 2003 14:32:17 -0700


Bugs item #778547, was opened at 2003-07-27 11:29
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=778547&group_id=9579

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: UTF-8 mode files won't save with non-ASCII characters

Initial Comment:
Changing "Defaulr Source Encoding" to UTF-8 prevents 
error messages for files with "european characters" 
(ÄÖÜ). However the file will not save any longer...

Remove those characters and saving is o.k. again.
Michael Peuser

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2003-07-31 14:32

Message:
Logged In: NO 

I noticed the same problem with these characters (in my case
they were "à" and "è"").
Here is what I get in the shell, when trying to save from Idle:


>>> Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\PROGRA~1\Python23\lib\lib-tk\Tkinter.py", line
1345, in __call__
    return self.func(*args)
  File "C:\PROGRA~1\Python23\lib\idlelib\IOBinding.py", line
335, in save
    if self.writefile(self.filename):
  File "C:\PROGRA~1\Python23\lib\idlelib\IOBinding.py", line
370, in writefile
    chars = chars.replace("\n", self.eol_convention)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 365: ordinal not in range(128)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=778547&group_id=9579