On Wed, Jul 6, 2011 at 3:14 AM, zensign <[email protected]> wrote: > @file and @nosent work Ok. > Problem is in @shadow !
My profuse apologies for the delay in responding. Rev 4636 of the trunk fixes several unicode related problems. However, before going into details about the fixes, let me emphasize that when you use non-default encodings, you *must* use @encoding directives or Python's -*- coding lines to specify the proper encoding to use in a file. I should have said this months ago: using @encoding would have been the workaround, and it is *still* what you must do. Having said that, here is the checkin log: Fixed several encoding problems related to this thread: @shadow - @encoding windows-1250 - problem http://groups.google.com/group/leo-editor/browse_thread/thread/a4ba80559447218a/9a37a4ed6c44d452 There were several real problems fixed. The summary: @encoding directives were always required and are *still* required for unusual (non-default) encodings *unless* a Python -*- coding line is the very first line of the file. In detail: 1. at.initWriteIvars now checks for a Python # -*- coding: line. If present, it must be the very first line. If present, it will override any @encoding directives. 2. g.getPythonEncodingFromString now can deal with either of the following lines: @first # -*- coding: utf-8 -*- # -*- coding: utf-8 -*- That is, g.getPythonEncodingFromString can strip the leading @first. 3. g.readlineForceUnixNewline and x.propagate_changes now catch UnicodeDecodeError. This is very important: previously decoding errors crashed Leo!. 4. x.propagate_change now does the preread in 'rb' mode. This seems to be essential. All unit tests pass with both Python 2.x and 3.x. 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.
