chinese ascii

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2006
Posts: 26
Reputation: gabs is an unknown quantity at this point 
Solved Threads: 1
gabs's Avatar
gabs gabs is offline Offline
Light Poster

chinese ascii

 
0
  #1
Mar 8th, 2007
I am trying to use chinese letters in a c++ program I'm writing. does anyone know how this can be done?
I know that:
TEXT("\u03a3")
will print out a latin letter, so how do I get a chinese character, and perhaps there is an easier way?

I need this asap,

thanks
Gabrielle
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: chinese ascii

 
0
  #2
Mar 8th, 2007
What are you trying to do? web-page, data crunching, simple test programs.. ??
Anyway all I remember is that from C++ you just gotta print the chars as they are, depending on where they are being printed (on console/web-page...) it'll appear appropriately ! I.e. if the fonts are appropriately installed and configured for the console/web-page. Although for web-pages you also have some http tags to consider.
Only thing to keep in mind while coding is that use wchar (or may be it was uchar) instead of char, as char can't represent all chinese characters (there are more than 256).
Check up MSDN for chapters on Unicode support may be you'll find something.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 26
Reputation: gabs is an unknown quantity at this point 
Solved Threads: 1
gabs's Avatar
gabs gabs is offline Offline
Light Poster

Re: chinese ascii

 
0
  #3
Mar 8th, 2007
I'm using TCHAR, I need to write a chinese word on a button. It doesn't work by simply entering them.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,348
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1461
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: chinese ascii

 
0
  #4
Mar 8th, 2007
do you have your compiler set up to define UNICODE and _UNICODE macros? Otherwise, I don't know a thing about Chinese language.

Also, here is something I found with google. It appears your computer needs to have Chinese language installed.
Last edited by Ancient Dragon; Mar 8th, 2007 at 11:17 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: chinese ascii

 
0
  #5
Mar 8th, 2007
and even if you do, the display device has to know how to display those Unicode characters or it will show something else.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: chinese ascii

 
0
  #6
Mar 9th, 2007
Originally Posted by gabs View Post
I'm using TCHAR, I need to write a chinese word on a button. It doesn't work by simply entering them.
Then all the more reason to read MSDN for chapters on Unicode support may be you'll find something.

If UNICODE is not defined TCHAR expands to just a char.

If you're using MFC, may be you can use CFont as well. (make sure that appropriate font is already installed on your PC as jwenting says.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC