>I have a text file with wide characters. I use the following C++ code to
>read
[quoted text clipped - 16 lines]
> }
> }

Signature
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
What Encoding should I use if the text file contains both Ascii (one byte)
and Chinese characters (2 bytes)? I try Unicode, BigEndianUnicode, ASCII,
UTF8, UTF7 (the only choices I can see in the Encoding class member), none of
them work.
> >I have a text file with wide characters. I use the following C++ code to
> >read
[quoted text clipped - 26 lines]
> Also, why are you reading it char by char when you have the full
> capabilities of the StreamReader at your disposal?
Carl Daniel [VC++ MVP] - 15 Oct 2005 18:15 GMT
> What Encoding should I use if the text file contains both Ascii (one
> byte)
> and Chinese characters (2 bytes)? I try Unicode, BigEndianUnicode, ASCII,
> UTF8, UTF7 (the only choices I can see in the Encoding class member), none
> of
> them work.
You need to use Encoding::GetEncoding() to find the appropriate encoding.
The ASCII, UTF8, ... members of the Encoding class are just shortcuts for
the most commonly used encodings.
In your case, you probably want something like
Encoding::GetEncoding("big5").
-cd
Kueishiong Tu - 16 Oct 2005 15:06 GMT
Carl:
You are absolutely right. Thank you very much for your and Tomas's help.
Kueishiong Tu
> > What Encoding should I use if the text file contains both Ascii (one
> > byte)
[quoted text clipped - 11 lines]
>
> -cd