i am reading an xml, wiht XMLch [] , but when characters above ascii reached then thi

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • efarooq
    New Member
    • Nov 2012
    • 1

    #1

    i am reading an xml, wiht XMLch [] , but when characters above ascii reached then thi

    how to read UTF-8 characters from a xml file in c++, not using XMLCh type?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    UTF-8 does not mean you have a character that can fit in a char. UTF-8 is a Unicode encoding. The Unicode characters are 16-bit or wider and in C++ you can use wchar_t for the ones up to 16 bits. A wchar_t character is called a wide char.

    The C++ library has functions for these wide characters, like wcout, wcin, wstring, etc.

    However, being able to read the bit pattern does not mean you can display the Unicode glyph. You will need language localization functions for this.

    Comment

    Working...