Using Expat with UNICODE on LINUX???

S

sprotty

Hi

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
conversion.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,184
Latest member
ZNOChrista

Latest Threads

Top