By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,515 Members | 1,772 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,515 IT Pros & Developers. It's quick & easy.

UNICODE

P: n/a
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.

Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Nov 11 '05 #2

P: n/a
> 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?

Nov 11 '05 #3

P: n/a
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
Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.