Re: GdomeDOMString and UTF-16
Luca Padovani <[email protected]> Fri, 05 Dec 2003 11:38:39 +0100
| Newsgroups | gmane.comp.gnome.gdome |
|---|---|
| Message-ID | <1070620718.732.27.camel@giraffe> |
Hello, On Fri, 2003-12-05 at 10:18, Laurent Marzullo wrote: > I would like to know about UTF16 support for GdomeDOMString ? there is no direct support for UTF16 in the GdomeDOMString "class"; however... > May I use UTF16 inside my XML while parsing with gdome or not ? yes, the XML file can use whatever character encoding is supported by libxml2, but once the document is loaded in memory, strings are represented in UTF8. In this respect Gdome2 is not fully compliant with the DOM specification, but given its architecture (a wrapping layer around libxml2) and the context (Linux platform, where UTF8 has always been preferred) it is "coherent" in some sense. > If yes, could you explain or point to document explaining how > it's handle by GdomeDOMString ? if you want to use UTF16 you need to write conversion routines by yourself. Don't know whether libxml2 has some facilities for this (likely?). Or -- but I know this makes most people smash their head against the wall -- you can use the C++ binding (gmetadom) where conversions to/from UTF16 and UCS4 are automatic. Example of gmetadom code: DOM::UTF16String s = node.get_nodeValue(); Regards, -- luca