Re: libxml2 in gnome 1.4



On Thu, Mar 22, 2001 at 02:34:15PM +0100, ERDI Gergo wrote:
> On Thu, 22 Mar 2001, James Henstridge wrote:
> 
> > So this 1.x version will cause problems for programs that don't handle
> > encodings correctly?  I am sure there is a fair number of libxml1 programs
> > that do something like this:
> >   grab text out of GtkEntry (or GtkText, or whatever)
> >   put text in xmlNode as content
> >   save XML file
> >   load XML file
> >   grab content of xmlNode
> >   put text in entry
> > 
> > (which will work great for english, and quite often works for other
> > locales).
> 
> This is exactly my use case -- could you tell me what I should do between
> steps 1 and 2, and 5 and 6?

  Depends on the encoding used by GtkEntry or GtkText, if this is
restricted currently to ISO-Latin-1 then a simple routine can be used
to convert:
    - from ISO-Latin-1 to UTF8 in between 1 and 2
    - from UTF8 to ISO-Latin-1 between 5 and 6
I have such routines isolat1ToUTF8() and UTF8Toisolat1() in libxml2
(they are also present in libxml1 with a different signature but they are
 not exported publicly so that something I may be able to fix before the
 final 1.8.12 release).
But maybe since GTK2 will be heavilly UTF8 based it's better to introduce
such conversion routines at the GTK level and not rely on libxml for this.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

_______________________________________________
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]