Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Using Expat with UNICODE on LINUX???

Thread Tools

Using Expat with UNICODE on LINUX???
Posts: n/a

Im porting a class library from Windows to linux. It needs to be
posible for other developers to make use of the resulting library. So I
need to take the 'standard' approach to the UNICODE aspects of the

Internally i'm using the Expat XML parser, which only seems to work
correctly when you pass it unicode strings that are 2 bytes per char
(if anyone knows better please let me know).

So I have 2 options, I compile it using the -fshort-wchar (which causes
wchar_t to be defined as 2 bytes) or convert the 4 byte wchar_t to a 2
byte version before passing it to Expat, then convert the output back
to 4 bytes per char.

The first option would be the best, but I feel this would make my
library incompatable with any application that does not use the
-fshort-wchar flag.

The second option is inconvient and slows things down.

Any suggestions

I've only been playing with Linux for a little while now so if any of
this sounds na´ve, then thats why!

Regards Simon

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
A c program which printing the tag value of a xml file using expat parser in linux environment sharan XML 5 08-26-2011 09:36 AM
build a hierarchical tree, without using DOM,schema, and sax using expat parser and c XML 2 11-05-2007 02:24 PM
Want help on how we convert output to tabular format Using the expat parser ( i have to parse the following xml file and print it on the screen in tabular format. sharan XML 1 10-26-2007 01:20 PM
Using the expat parser ( i have to parse the following xml file and print it on the screen in tabular format. Want a c program on that! sharan XML 1 10-26-2007 07:56 AM
Xml validation againest DTD using expat sush XML 1 02-24-2006 12:51 PM