Re: commit (HEAD): IMPORTANT - 32-bit UT_UCSChar

From: Christian Biesinger (cbiesinger@web.de)
Date: Mon May 06 2002 - 10:52:43 EDT

  • Next message: Andrzej Pruszynski: "Re: Maybe we shouldn't spam the world with the 1.0 release announcement?"

    On Mon, May 06, 2002 at 03:45:23PM +0100, Andrew Dunbar wrote:
    [ucs2 to ucs4]
    > There should
    > be functions to convert from a UCS2String to a
    > UCS4String and vice versa.

    This can be pretty easily done using UT_convert, see below.

    > If there isn't they are
    > pretty easy to implement using iconv. It might
    > require memory allocation though so you'll have to
    > be prepared to handle the case of it failing.

    Well, the best way would be (imho) to use UT_convert, which handles memory
    allocation itself.

    You'd just do:
    UT_UCS4Char* foo = (UT_UCS4Char*)UT_convert((char*)your_string,
    len_of_your_string, "UCS-2", "UCS-4", NULL, NULL);

    -- 
    "They that can give up essential liberty to obtain a little temporary
    safety deserve neither liberty nor safety."
                                                     -- Benjamin Franklin
    




    This archive was generated by hypermail 2.1.4 : Mon May 06 2002 - 10:55:51 EDT