string again

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jiang lei

    string again

    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<wc har_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?

  • Victor Bazarov

    #2
    Re: string again

    "jiang lei" <tristone@delux e.ocn.ne.jp> wrote...[color=blue]
    > Sorry if someone ever posted this question before.[/color]

    Why? What's so bad about posting it again?
    [color=blue]
    > I was wondering if there is a generic solution to string processing, if[/color]
    not[color=blue]
    > on all, at least on most of the platforms. std::string could've been good[/color]
    if[color=blue]
    > it can cope with unicode characters. On Linux Redhat 8.0, even
    > basic_string<wc har_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.[/color]

    You ran into a bad implementation, I believe.
    [color=blue]
    > 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[/color]
    is[color=blue]
    > much too high because it comes with a 10MB runtime..
    >
    > Any ideas?[/color]

    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


    Comment

    Working...