UNICODE

Discussion in 'C++' started by Gaijinco, Nov 11, 2005.

  1. Gaijinco

    Gaijinco Guest

    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.
     
    Gaijinco, Nov 11, 2005
    #1
    1. Advertising

  2. 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
     
    Victor Bazarov, Nov 11, 2005
    #2
    1. Advertising

  3. Gaijinco

    Gaijinco Guest

    > 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?
     
    Gaijinco, Nov 11, 2005
    #3
  4. 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
     
    John Harrison, Nov 11, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram
    Replies:
    0
    Views:
    4,039
    Robert Mark Bram
    Sep 28, 2003
  2. ygao

    unicode wrap unicode object?

    ygao, Apr 8, 2006, in forum: Python
    Replies:
    6
    Views:
    590
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 8, 2006
  3. Gabriele *darkbard* Farina

    Unicode digit to unicode string

    Gabriele *darkbard* Farina, May 16, 2006, in forum: Python
    Replies:
    2
    Views:
    561
    Gabriele *darkbard* Farina
    May 16, 2006
  4. gabor
    Replies:
    13
    Views:
    584
    Leo Kislov
    Nov 18, 2006
  5. Jean-Paul Calderone
    Replies:
    23
    Views:
    723
    Leo Kislov
    Nov 21, 2006
Loading...

Share This Page