[spe.pycs.net] Re: mailing list active ? problem with 0.5.1.E

mjekl mjekl at clix.pt
Wed Sep 15 21:12:36 CEST 2004


 <mail at ...> writes:

> In fact it probably hasn't anything to do with the characters in the 
directory name but with that ones in your
> file. 
> 
> The reason is a "feature" in the wxStyledTextControl from wxPython Spe uses. 
This text control always
> tries to save files with the python standard encoding which happens to be 
ascii out of the box. If your file
> isn't ascii encoded (e.g. if you are using non-ascii chars in comments or 
strings), you get the above
> error. 
> 
> Perhaps the problem arises as well with non-ascii directory names, but I 
haven't tested that. 
> 
> The solution I found will probably work any way so here is it:
> 
> In the "site-packages" directory in my python dir (/usr/lib/python/site-
packages on my linux box) I
> created a file named "sitecustomize.py" with the following content:
> 
> -----------------
> import sys
> 
> sys.setdefaultencoding('iso-8859-1')
> -----------------
> 
> This script is run automatically on python startup and sets the default 
encoding to 'iso-8859-1'. Please
> insert your appropriate encoding, e.g. 'utf-8'. 
> 
> Everything should work fine now. 
> 
> Bye, 
> 
> Benno.
> 

THANK YOU, THANK YOU, BENNO!
YOU ARE THE GREATEST!!!

I can't believe I've seen (and posted) so many times on this "issue". It's 
really an ISSUE for everyone who uses more than plain-old ascii. And the answer 
was so simple (when you know it :-).

There's some free beer for you if you ever come this way (Portugal)!

Best,
mjekl




More information about the Spe-user mailing list