UNICODE

G

Gaijinco

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

Victor Bazarov

Gaijinco said:
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
 
G

Gaijinco

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?
 
J

John Harrison

Gaijinco said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top