List Info

Thread: problem with accents




problem with accents
user name
2007-01-05 11:04:13

Hello,

I have a question about libxml2:

when i use xmlParseMemory (buffer, strlen(buffer));

the accents (יטאפ...) who were in my buffer aren't anymore in the result of this method.

How can i do to keep them or to tranform them before the parsing?

Best regards   

-----------------------------------------------------------------------------
Arnaud Lafragueta
Sopra Group - Division Telecom
Tour ORION - 12-16 Rue de Vincennes 93100 MONTREUIL
Tel: +33 (0)1 49 88 64 86
e-*:
< alafraguetasopragroup.com">mailto:alafraguetasopragroup.com>
-----------------------------------------------------------------------------


problem with accents
user name
2007-01-08 07:14:40
Lafragueta Arnaud wrote:
> Hello,
> 
> I have a question about libxml2:
> 
> when i use xmlParseMemory (buffer, strlen(buffer));
> 
> the accents (יטאפ...) who were in my buffer aren't
anymore in the result
> of this method.

Sure they are - provided the string is in UTF8 encoding as
required by
the libxml API.

> How can i do to keep them or to tranform them before
the parsing?

If your string is in latin-1 encoding, libxml provides
function to
encode latin-1 into utf-8 (and vice versa).  Otherwise, look
into using
iconv() or similar functionality.
Alternatively, write your XML to a file with a suitable
encoding set in
the XML declaration and parse from that file - then libxml
will (try to)
handle encoding issues.


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )