This may not be a Leo problem (maybe a QT problem? I'm using Ubuntu 10.04), 
but Leo is the place that it crops up, so here it is:

I can type accents in the body pane without a problem. So I can write this:

import sys

e = sys.getdefaultencoding()
g.es('encoding',e)

g.es("test: é")

But when I run the script in Leo (Ctrl-B) I get an error: 

exception executing script
  File "/home/bill/.leo/scriptFile.py", line 10
SyntaxError: Non-ASCII character '\xc3' in file 
/home/bill/.leo/scriptFile.py on line 10, but no encoding declared; see 
http://www.python.org/peps/pep-0263.html for details (scriptFile.py, line 
10)
--------------------
  line 9: 
* line 10: g.es("test: é")
  line 11: #@-leo
  line 12: 

(Interesting that the error message prints the accent in the log pane 
without a problème!.... :)

I get that error even when the line with the offending accent is commented 
out. And if I run the code after erasing the last line,  it prints the utf-8 
encoding.

Under python, there is no problem (I have set the encoding in 
sitecustomize.py):

bill@bill-laptop:~/Soft/leo-editor$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
>>> print "é"
é
 
And the workbook file is properly encoded: <?xml version="1.0" 
encoding="utf-8"?>. mysettings.leo too, as far as I can tell. 

I have tried this both under screen and without screen (I use the leoscreen 
plugin) and  LC_ALL=en_US.UTF8  for all the LC. 

I tried @encoding="utf-8"; no luck either.

So I am at a loss. Any suggestions? 

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/leo-editor/-/4M05aBx3toEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to