On Fri, 12 Jan 2001, James Henstridge wrote:

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

 Yes, it's using libxml2.
 
> (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.

  Just tried to save then load russian in dia - the text is corrupted (it
 seems due to the same problem). So recoding to utf8 should be performed on
 input and output. This will require a reasonable iconv() implementation to be
 available in libc or standalone... 

> When we move to gtk 2.0, then we will probably need to use UTF-8 anyway.

 It seems this problem should go away automatically when gtk 2.0 will be used
since gettext() will return strings in utf8, and all input from the keyboard
will also be in utf8.

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

 Best regards,
  -Vlad

Reply via email to