The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help replacing or scrubbing unicode characters roninuta Shell Programming and Scripting 3 01-21-2008 07:39 AM
problem with Unicode characters insertion suman_jakkula AIX 0 02-10-2006 09:20 PM
How to make static unicode string? sledge76 High Level Programming 1 01-19-2005 02:44 AM
unicode rein UNIX for Advanced & Expert Users 2 01-18-2005 10:40 AM
converting string to unicode webtekie Shell Programming and Scripting 1 07-21-2004 08:43 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-18-2005
Registered User
 

Join Date: May 2005
Posts: 2
Stumble this Post!
How to display unicode characters / unicode string

I have a stream of characters like "\u8BBE\u5907\u7BA1"
and i want to display it.


I tried following things already without any luck.

1) printf("%s",L("\u8BBE\u5907\u7BA1"));
2) printf("%lc",0x8BBE);
3) setlocale followed by fwide followed by wprintf
4) also changed the local manually verified LC_CTYPE and LC_LANG etc.

it just doesn't display anything at all.

Note:
if i try printf("%lc",ox201c); which is a unicode for double quotes. it does display double quotes.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-18-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,808
Stumble this Post!
Consider UTF-8

See:

http://eyegene.ophthy.med.umich.edu/unicode/
Reply With Quote
  #3 (permalink)  
Old 05-19-2005
Registered User
 

Join Date: May 2005
Posts: 2
Stumble this Post!
looked at the sight but did not get any info related to printing chars in \uXXXX format.
Reply With Quote
  #4 (permalink)  
Old 05-20-2005
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,808
Stumble this Post!
I wasn't clear. Sorry. ISO C (not Windows, VC++ is not ANSI) doesn't accept \u as a valid escape sequence. Some compilers may do that...

You will have to use wide chars or something else like UTF-8 encoding before you try to print it. In other words you will have to change the data format.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0