Using Expat with UNICODE on LINUX???

Discussion in 'XML' started by sprotty@hotmail.com, Mar 15, 2005.

  1. Guest

    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
    , Mar 15, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page