Chinese and C++

This is a discussion on Chinese and C++ within the C++ Programming forums, part of the General Programming Boards category; Is there anybody out there who can tell me if it's even possible to get C++ to read Chinese characters ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    30

    Question Chinese and C++

    Is there anybody out there who can tell me if it's even possible to get C++ to read Chinese characters from a text file into a multi dimensional array? I know Chinese Windows/DOS can display Chinese characters but I'm not sure why it won't display the ones I'm trying to display...wrong font?

    Thanks,

    Swaine777

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Use a UNICODE Font and a UNICODE way of reading strings. Everything more detailed is dependent on your Compiler/Library.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    For strings, use wchar_t instead of char. wchar_t means the unicode set of characters. For printing out a unicode string, use wcout. Basically, everything you need for unicode strings starts with a w (wcout, wcin, wstring, wcerr, etc). The C++ standard also comes with wide string functions.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21