473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Jul 19 '05 #1
1 1626
"jiang lei" <tr******@deluxe.ocn.ne.jp> 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
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: spike | last post by:
How do i reset a string? I just want to empty it som that it does not contain any characters Say it contains "hello world" at the time... I want it to contain "". Nothing that is.. Thanx
7
by: Matthias S. | last post by:
Hi, I had a look at the vast information on encryption in the MSDN and got pretty confused. All I want to do is to encrypt a string into an encrypted string and later decrypt that (encrypted)...
4
by: Julia | last post by:
Hi, I need to convert unicode string to ansi string Thanks in adavance.
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
4
by: SeNTry | last post by:
Hi Everyone, My first post here as I just begin to learn programming in general and python in particular. I have all the noobie confused questions, but as I work thru the tutorials I'm sure...
8
by: vidya.bhagwath | last post by:
Hello Experts, I am using std::string object as a member variable in one of the my class. The same class member function operates on the std::string object and it appends some string to that...
11
by: solarin | last post by:
Hi, I've the following code: //all variables are defined in the code Class CMessage{ string CMessage::GenerateString() {
21
by: phpCodeHead | last post by:
Code which should allow my constructor to accept arguments: <?php class Person { function __construct($name) { $this->name = $name; } function getName()
5
by: erictheone | last post by:
so here is my code. My getlines for the strings keyword and phrase at lines 44 and 79 respectively don't work. Please help!!! #include <cstdlib> #include <string> #include <iostream> #include...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.