Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > UNICODE

Reply
Thread Tools

UNICODE

 
 
Gaijinco
Guest
Posts: n/a
 
      11-11-2005
What's the deal with printing Unicode characters in C++? I haven't
found any source that deals with this matter on the web or on a book.
I'm a latin speaker so I'm specially intresting in pronting characters
like "", "" and ""

Thanks.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-11-2005
Gaijinco wrote:
> What's the deal with printing Unicode characters in C++?


Universal characters need to be specially coded using \uXXXX notation,
IIRC.

> I haven't
> found any source that deals with this matter on the web or on a book.


I can't say anything about any books on the subject, but I am quite
surprised that you couldn't find any source on the web.

V
 
Reply With Quote
 
 
 
 
Gaijinco
Guest
Posts: n/a
 
      11-11-2005
> Universal characters need to be specially coded using \uXXXX notation,

What you have doesn't work, what it work was:

\x(ASCII code)

Like if I want to print "@" then I write:

cout << "\x40"

But what about something like japanese characters and the like?

 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      11-11-2005
Gaijinco wrote:
>>Universal characters need to be specially coded using \uXXXX notation,

>
>
> What you have doesn't work, what it work was:
>
> \x(ASCII code)
>
> Like if I want to print "@" then I write:
>
> cout << "\x40"
>
> But what about something like japanese characters and the like?
>


If your compiler doesn't accept \uXXXX then it is time to get a better
compiler.

Also please be aware that getting a Unicode character into your program,
and getting to display correctly when you output it are two completely
different things.

You solve the first using what Victor showed you, the second is up to
your operating system and doesn't have much to do with C++.

john
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!? Jean-Paul Calderone Python 23 11-21-2006 10:25 AM
os.lisdir, gets unicode, returns unicode... USUALLY?!?!? gabor Python 13 11-18-2006 09:23 AM
Unicode digit to unicode string Gabriele *darkbard* Farina Python 2 05-16-2006 01:15 PM
unicode wrap unicode object? ygao Python 6 04-08-2006 09:54 AM
Unicode + jsp + mysql + tomcat = unicode still not displaying Robert Mark Bram Java 0 09-28-2003 05:37 AM



Advertisments