Re: my worry about the recent libxml change



On Fri, 23 Mar 2001, Colm Smyth wrote:

> I don't think the real issue is with codeset detection when parsing
> XML files; this can be handled in functions like xmlCreateDocParserCtxt(),
> xmlSAXParseDTD(); look for calls to xmlSwitchEncoding().
> 
> For me, the main questions are
> 
> 1. how to decide the appropriate "default" codeset of the application
> 2. where to call the routines for conversion to that codeset

 As I understand, the question is: should we change libxml1 to be conformant
and possibly break all apps that use it, or not..

 As for detecting charsets in which to load or save - I think it's better to
stick that logic into libxml1. So, apps shouldn't call conversion routines at
all (none do now, and provided we are not going to fix every app, we shouldn't
add such calls).

 As for loading xml files: I want to stress that it's much better and not
error prone at all to test whether the string loaded from file is a valid utf8
string, and treat it as utf8 string, and if it's invalid - treat it as if it
was in locale's charset. No need to stick to exactly one encoding of xml
files - we are lucky that we have an option to guess encoding of the string!

> So long as an application *can* choose what codeset it wants to see, or
> is able to specify that it wants data in it's "natural" codeset from the
> original source (e.g. a file), then it's ok to have a sensible
> default conversion; it would be bad news to have an automatic
> conversion that you couldn't override.
> 
> If there are any classes of XML files in GNOME that could be converted to
> utf-8 before shipping GNOME 2.0, that would make life easier (the same
> goes for other text files, like .desktop).
> 
> Colm.
> 
> >Delivered-To: gnome-private-members gnome org
> >Delivered-To: gnome-hackers gnome org
> >Subject: Re: my worry about the recent libxml change
> >From: Dan Winship <danw ximian com>
> >To: Vlad Harchev <hvv hippo ru>
> >Cc: Darin Adler <darin eazel com>, Gnome Hackers <gnome-hackers gnome org>
> >Mime-Version: 1.0
> >X-BeenThere: gnome-hackers gnome org
> >X-Loop: gnome-hackers gnome org
> >X-Mailman-Version: 2.0beta5
> >List-Id: <gnome-hackers.gnome.org>
> >X-BeenThere: gnome-private-members gnome org
> >X-Loop: gnome-private-members gnome org
> >
> >> * When saving xml files, locale's charset name should be saved in xml header.
> >
> >But this doesn't deal with .oaf files, which have descriptions in
> >multiple encodings.
> >
> >-- Dan
> >
> >_______________________________________________
> >gnome-hackers mailing list
> >gnome-hackers gnome org
> >http://mail.gnome.org/mailman/listinfo/gnome-hackers
> >
> >
> 

 Best regards,
  -Vlad


_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]