string again

Discussion in 'C++' started by jiang lei, Jul 25, 2003.

  1. jiang lei

    jiang lei Guest

    Sorry if someone ever posted this question before.

    I was wondering if there is a generic solution to string processing, if not
    on all, at least on most of the platforms. std::string could've been good if
    it can cope with unicode characters. On Linux Redhat 8.0, even
    basic_string<wchar_t> will not compile because basic_string::c_str() looks
    something like this:

    if(nodata)
    return "";
    else
    return data();

    The hard-coded zero length string never agrees with a w_char* return type.


    The only other thing I can come up with is ICU. It has a unicode string
    class and can play all the code page conversion tricks. However, the cost is
    much too high because it comes with a 10MB runtime..

    Any ideas?
    jiang lei, Jul 25, 2003
    #1
    1. Advertising

  2. "jiang lei" <> wrote...
    > Sorry if someone ever posted this question before.


    Why? What's so bad about posting it again?

    > I was wondering if there is a generic solution to string processing, if

    not
    > on all, at least on most of the platforms. std::string could've been good

    if
    > it can cope with unicode characters. On Linux Redhat 8.0, even
    > basic_string<wchar_t> will not compile because basic_string::c_str() looks
    > something like this:
    >
    > if(nodata)
    > return "";
    > else
    > return data();
    >
    > The hard-coded zero length string never agrees with a w_char* return type.


    You ran into a bad implementation, I believe.

    > The only other thing I can come up with is ICU. It has a unicode string
    > class and can play all the code page conversion tricks. However, the cost

    is
    > much too high because it comes with a 10MB runtime..
    >
    > Any ideas?


    About once a month here Nikki Locke posts a short summary and a link to
    a page with enormous list of "Available C++ Libraries". You probably want
    to search for the last post using http://groups.google.com . I have little
    doubt that you can find what you're looking for in that extensive list of
    libraries of all sorts.

    Victor
    Victor Bazarov, Jul 25, 2003
    #2
    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.
Similar Threads
  1. amit
    Replies:
    0
    Views:
    388
  2. che
    Replies:
    2
    Views:
    491
  3. abcd

    Importing again and again

    abcd, Jun 8, 2006, in forum: Python
    Replies:
    9
    Views:
    326
    Maric Michaud
    Jun 9, 2006
  4. Replies:
    4
    Views:
    404
  5. Ò»Ê×Ê«

    A design problem I met again and again.

    Ò»Ê×Ê«, Apr 1, 2009, in forum: Python
    Replies:
    24
    Views:
    722
    Dennis Lee Bieber
    Apr 4, 2009
Loading...

Share This Page