string again

J

jiang lei

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

Victor Bazarov

jiang lei said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top