On Sun, Aug 30, 2009 at 5:34 PM, Edward K. Ream<[email protected]> wrote:
>
> Should I change this to default to sys.stdout.encoding? If so, why?
>
> With the present code, according to the comments, g.pr will produce byte
> hash if we don't set the default encoding to 'utf-8' in sitecustomize.py.
g.pr("ää") script gives me:
QQQ
File "/home/ville/.leo/scriptFile.py", line 3
SyntaxError: Non-ASCII character '\xc3' in file
/home/ville/.leo/scriptFile.py on line 3, but no encoding declared;
see http://www.python.org/peps/pep-0263.html for details
(scriptFile.py, line 3)
The scriptfile is
#...@+leo-ver=4
#...@+node:test uc
g.pr("äää")
#...@nonl
#...@-node:test uc
#...@-leo
Actually, we need to define encoding in the beginning of script file by
#!/usr/bin/python
# -*- coding: utf-8 -*-
(as in http://www.python.org/dev/peps/pep-0263/ )
--
Ville M. Vainio
http://tinyurl.com/vainio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
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
-~----------~----~----~----~------~----~------~--~---