On Sat, Oct 18, 2008 at 3:05 PM, Alex Polite <[EMAIL PROTECTED]> wrote:

> Still no go. Now I get this when trying to save a tree where I've
> pasted (still can't enter via normal means) some unicode chars:

I've made some changes related to cut/paste, the clipboard and unicode
on rev 1313.  Most things work.  Some notes:

1. Headlines don't "stick" after a paste unless you move away from the
node before saving.  I'll be reviewing the headline code soon.

2. Pasting an Arabic character in a headline doesn't just work, it
shows a really cool feature: you can mix right-to-left text with
left-to-right text, and a little superscript will show you the script
direction.  Cool.

3. In contrast, pasting a non-ascii character into the body pane (a
QScintilla widget) produces the dreaded '?' character.  It's possible
that this character arises from Leo's core logic, say via a call to
g.toEncodedString or something like that...I'll be checking this soon.

> Traceback (most recent call last):
> File "/home/oivvio/opc/qt-plugin/leo/core/leoGlobals.py", line 3071,
> in pr sys.stdout.write(s+'\n')
> UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in 
> position 16: ordinal not in range(128)

The following comment appears in g.pr:

QQQ
Important:  Python's print statement *can* handle unicode. However,
the following must appear in Python\Lib\sitecustomize.py:
sys.setdefaultencoding('utf-8')
QQQ

Have you tried this? Leo is oriented to unicode with utf-8 encoding,
and the call to sys.setdefaultencoding should solve this problem.

Edward

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to