473,382 Members | 1,611 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,382 software developers and data experts.

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

Hi,

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.


Regards,
Jay
Sep 16 '10 #1
1 2733
weaknessforcats
9,208 Expert Mod 8TB
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

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

Similar topics

4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
7
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese...
1
by: Hitesh | last post by:
Hi, I am getting an error while loading a file having Chinese characters. I am using XMLDocument to parse the XML. Please let me know if you have any idea about the same Thanks
19
by: many_years_after | last post by:
Hi,everyone: Have you any ideas? Say whatever you know about this. thanks.
8
by: Wijaya Edward | last post by:
Hi all, I was trying to split a string that represent chinese characters below: ??? But why the split function here doesn't seem
0
by: limodou | last post by:
---------- Forwarded message ---------- From: limodou <limodou@gmail.com> Date: Oct 27, 2006 11:51 AM Subject: Re: How to Split Chinese Character with backslash representation? To: Wijaya Edward...
2
by: Clive Green | last post by:
Hello peeps, I am using PHP 5.2.2 together with MP3_Id (a PEAR module for reading and writing MP3 tags). I have been using PHP on the command line (Mac OS X Unix shell, to be precise), and am...
6
by: Bill Fuller | last post by:
I believe that C# uses Unicode by default for string characters. Does that mean that double-byte langauges such as Chinese can be used without doing anything special... including DB persistance?...
13
by: Liang Chen | last post by:
Hope you all had a nice weekend. I have a question that I hope someone can help me out. I want to run a Python program that uses Tkinter for the user interface (GUI). The program allows me to type...
7
by: goe | last post by:
Hi All, The software I'm working on uses the CODE39 barcode font to converts regular strings into the barcode labels. However we're now in the process of internalization and we need to add support...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.