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