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're welcome.
Edward