Thread: Chinese and C++

  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,130
    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