Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Im working on a cross plateform development whereby Im sending a UTF-8 based message data (containing Chinese characters) from Windows to Linux.

Now on the Linux side (using C++), I need to compare each line to find the Chinese string Im looking for and do the processing based on if I find the Chinese strings.

The question is that even though I can see the Chinese string exist in the message that Im reading on the Linux side, the comparison is not finding it. Im using std::wstring and using the find() method of the wstring.

When I print the message to the standard output (console) in Linux, I can see the Chinese string, but find is not finding it. In the Linux side, I am prefixing the Chinese string with "L" i.e. L "<chinese string="">".

Will appreciate any help in figuring out why the Chinese string is not being found even though it exists.

THanks
Posted

1 solution

This is a great project:
ICU - International Components for Unicode[^], it will do the job on windows and linux.

Regards
Espen Harlinn
 
Share this answer
 
Comments
JF2015 15-Jan-11 10:25am    
Good link. Will try to get to know this library if I have some spare time. 5+
Espen Harlinn 15-Jan-11 10:28am    
Thanks JF2015!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900