By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,394 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

How to split the chinese characters[ double bytes] without getting them truncated.

P: 1

I am required to read the chinese characters that come as a string and split them into 4 smaller strings and print it on a A4 paper.

I converted the string to wide character using mbstowcs() and then copied the wide character strings using wcsncpy.

But I am only able to print the strings using %x , which gives the result in hexadecimal. But I am required to print the chinese string that does not get truncated.

Sep 16 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
A wide string is not a Unicode string.

The %x is suspicious. It smells of wprintf().

You cannot print Chinese using wprintf().

Research how to process Unicode strings in your operating system. Most of the information will be found when you search for localization.
Sep 16 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.