On Jan 31, 5:37 pm, "Edward K. Ream" <[email protected]> wrote:

>> there could be an interaction between unicode problems and xml escapes in
>> leoFileCommands.putTnode.

Yikes.  This is quite a topic.  See:

http://www.w3.org/TR/unicode-xml/

It looks to me like the question for Leo is whether to convert unicode
to an encoded string "early" in putTnode.  That is, whether to
uncomment the #### line below::

def putTnode (self,t):

    # New in Leo 4.4.8.  Assign v.t.fileIndex here as needed.
    if not t.fileIndex:
        g.trace('can not happen: no index for tnode',t)
        t.fileIndex = g.app.nodeIndices.getNewIndex()

    # New in Leo 4.4.2 b2: call put just once.
    gnx = g.app.nodeIndices.toString(t.fileIndex)
    ua = hasattr(t,'unknownAttributes') and self.putUnknownAttributes
(t) or ''
    b = t.b
    if b:
        #### Convert to encoded string ????
        #### b = g.toEncodedString
(b,self.leo_file_encoding,reportErrors=True)
        body = xml.sax.saxutils.escape(b)
    else:
        body = ''

    self.put('<t tx="%s"%s>%s</t>\n' % (gnx,ua,body))

Not that self.put converts its argument to an encoded string.

Can anyone say anything authoritative?

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