List Info

Thread: HOW TO Set-up charset encoding...




HOW TO Set-up charset encoding...
country flaguser name
Italy
2007-03-21 08:29:58
Hi,
 
I have develop a C process that process spool text file and build xml output file using xml-lib C-binding.
Input files can be in two kind of format:
-utf8
-cp850 (= ISO-8859)
 
To write xml file I use in my program:
xmlSaveFormatFileEnc
and I call it in this way:
xmlSaveFormatFileEnc(filename, doc, NULL, 1);
 
and then xml-lib assume that econding is utf8.
Indeed, I would like to specify "cp850" ecnording charset format or another one too.
Witch C #define I could use?
Anyone can give me an example?
 
Thanks in advance,
 
Roberto
Re: HOW TO Set-up charset encoding...
user name
2007-03-21 09:06:08
On Wed, Mar 21, 2007 at 02:29:58PM +0100, Roberto Bonuccelli
wrote:
> Hi,
> 
> I have develop a C process that process spool text file
and build xml output file using xml-lib C-binding.
> Input files can be in two kind of format:
> -utf8 
> -cp850 (= ISO-8859)
> 
> To write xml file I use in my program:
> xmlSaveFormatFileEnc
> and I call it in this way:
> xmlSaveFormatFileEnc(filename, doc, NULL, 1);
> 
> and then xml-lib assume that econding is utf8.
> Indeed, I would like to specify "cp850"
ecnording charset format or another one too.
> Witch C #define I could use? 
> Anyone can give me an example?

  Use the new APIs which use the strings and not enums
    http://xmlsoft.org/html/libxml-xmlsave.html#xmlSave
ToFilename
then it's a matter of libxml2 or iconv having support for
your 
target encoding.

Daniel


-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
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 )