Re: [xml] xmlChar * to char *



On Tue, Oct 24, 2006 at 10:30:37AM +0000, Chris Peto wrote:
Daniel Veillard <veillard <at> redhat.com> writes:


On Fri, Dec 16, 2005 at 01:41:15PM +0100, Baurzhan Ismagulov wrote:
On Fri, Dec 16, 2005 at 02:59:16AM -0500, Daniel Veillard wrote:
  an xmlChar * has a stricter semantic than char *, that's why
there is a macro to do this in one direction and not in the other one.

But gcc 4 warns about xmlChar * being passed to functions like strcpy; I
think the OP's question was whether there are any other solution than
casting.

  no, just cast.

I did a cast and still come up with a string that start with 0xc2.  My original 
character in xsd was &#xB0;.  By parsing I get, even after cast, c2b0 string.  
What must I do?

Learn, really if you're working for a web development company asking this
kind of question should really scare your customers ... I expect there is
some confusion on your side, a pointer cast *never* change the pointed memory.
Things you should read are libxml2 encoding page:

    http://xmlsoft.org/encoding.html

and pages pointed by it giving I18N details and the UTF-8 spec you seems 
to ignore:

    http://www.faqs.org/rfcs/rfc2279.html

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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