Using MBCS in a UNICODE defined project

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi, my project has the UNICODE and _UNICODE macros defined. I want to
display a lot of chinese text, and this is working well for me.

However, within the code, I make a call to a function:
TestFunction(char * input);

I need to supply it with MBCS format. So I use a T2A()....
TestFunction(T2A(input)); and all is good (assuming the string is
english alphabet chars).

However.. that "input" string is read from a text file. If the input
string is something like this..
"abcdefgXXXhigjklmop" - where "XXX" denotes some chinese MBCS chars

If i read that string my project reads it as unicode and gets it
wrong. How do i "tell" my application to read it as MBCS (it's always
MBCS)?

I hope this makes sense.. it's a bit confusing to me. The reading
worked correctly before i changed my app to UNICODE. now if there's
chinese chars in the file, it doesn't work.


I

.



Relevant Pages

  • Re: Typing Chinese
    ... but I would guess there is a different string type for ... Unicode, like wstring perhaps. ... When the user types Chinese in the textbox, ... >>store the Chinese characters. ...
    (microsoft.public.sqlserver.programming)
  • Re: Tranfering unicod charcters in Socket programming!
    ... You are telling about conversion b/w MBCS to Unicode. ... If this is not possible Shall I try with string to wstring ... int SendStringAsUnicode ...
    (microsoft.public.win32.programmer.networks)
  • Re: Code Page problem in SetWindowText
    ... to Unicode before calling NT internal routines and converting back to MBCS before returning to the caller. ... W take Unicode i.e. UTF-16. ... in most character sets, ... I understand that Unicode is the best way of string operations for morden ...
    (microsoft.public.vc.mfc)
  • Re: using structs like BROWSEINFO and OPENFILENAME (string members
    ... your discussion of unicode ... vs ansi reminded me to recheck my typelib and found a couple of errors. ... > is declared as string, the other is declared as long. ...
    (microsoft.public.vb.winapi)
  • Re: Typing Chinese
    ... It's a normal string (dim query as string) which holds the insert ... When the user types Chinese in the textbox, ... > store the Chinese characters (encoded as Unicode). ...
    (microsoft.public.sqlserver.programming)