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

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

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

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,388
    Robert Mark Bram
    Sep 28, 2003
  2. ygao

    unicode wrap unicode object?

    ygao, Apr 8, 2006, in forum: Python
    Replies:
    6
    Views:
    803
    =?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:
    729
    Gabriele *darkbard* Farina
    May 16, 2006
  4. gabor
    Replies:
    13
    Views:
    849
    Leo Kislov
    Nov 18, 2006
  5. Jean-Paul Calderone
    Replies:
    23
    Views:
    977
    Leo Kislov
    Nov 21, 2006
  6. Holger Joukl
    Replies:
    5
    Views:
    738
    Ben Finney
    Dec 13, 2006
  7. Kenneth McDonald
    Replies:
    1
    Views:
    1,075
    Carl Banks
    Dec 27, 2006
  8. =?utf-8?B?5Lq66KiA6JC95pel5piv5aSp5rav77yM5pyb5p6B

    Does unicode() equal to unicode(sys.getfilesystemencoding()) ?

    =?utf-8?B?5Lq66KiA6JC95pel5piv5aSp5rav77yM5pyb5p6B, Jun 6, 2007, in forum: Python
    Replies:
    1
    Views:
    542
    Peter Otten
    Jun 6, 2007
Loading...