Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   UNICODE (http://www.velocityreviews.com/forums/t449732-unicode.html)

Gaijinco 11-11-2005 05:34 PM

UNICODE
 
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.


Victor Bazarov 11-11-2005 05:46 PM

Re: UNICODE
 
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

Gaijinco 11-11-2005 06:16 PM

Re: UNICODE
 
> 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?


John Harrison 11-11-2005 06:30 PM

Re: UNICODE
 
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


All times are GMT. The time now is 04:13 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.