On Tue, 9 Jan 2001, Vlad Harchev wrote:
> Hi,
>
> Dia-0.86 can't load files saved under non-latin locales if localization of
> the word "Background" (the one used as the name of the base layer) contains
> non-ascii (or non-latin1) characters - libxml complaints about attribute value
> for some reason, and filename can't be imported. At least this is true for
> translations to russian (ru.po) - translation of 'Background' is 'æÏÎ', i.e.
> 0xe6 0xcf 0xce, but the name of the layer in XML becomes a litteral "揎"
> for some unknown reason.
Is this using libxml2? It looks like it may be caused by a conversion to
UTF-8, as the values are quite similar:
>>> u'\u63ce'.encode('utf-8')
'\346\217\216'
>>> '\xe6\xcf\xce'
'\346\317\316'
(The difference in the second 2 characters is in the second from highest
bit, which should be 0 in a utf character).
I guess we need to make libxml2 not treat the input as UTF-8, or decide
that UTF-8 is the only encoding allowed for dia files, and perform such an
encoding during save/load. The former is probably the easiest for now.
When we move to gtk 2.0, then we will probably need to use UTF-8 anyway.
> I've attached a patch that removes sympthoms of this problem - translation
> of 'Background' from /po/*.po for locales that I suspect, but it would be
> better if the underlying problem was fixed. Sorry, I don't have time to
> inspect it - I hope someone will fix it.
James.