Re: TCHAR string?



Daniel,

>> The term ASCII was used loosely in my post, but I should've said ANSI.
>
> You wrote:
> | When you use TCHAR, LPCTSTR, etc. and define your string constants
> | using _T("Here's a string"), your strings will be ASCII when you
> | do a multibyte build, and they'll be Unicode when you do a Unicode
> | build.
>
> ANSI is just as wrong as ASCII in that context.

Then what does the "A" stands for at the end of Windows API functions that
accept non-Unicode strings?

> The important thing to grasp is that both MBCS and Unicode builds suffer
> from the fact that a single character may need to be encoded into more
> than one TCHAR (depending on the character set being used), but in MBCS
> a TCHAR is 8 bits while in Unicode it is 16 bits.

I thought the whole point of Unicode was that only one TCHAR was required
for each character?

--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com


.



Relevant Pages

  • Re: _TCHAR* to char*
    ... The whole point of TCHAR is ta make code compilable in Unicode or ANSI. ... If UNICODE is not #defined, TCHAR becomes "char", and no translation is necessary. ...
    (microsoft.public.vc.language)
  • Re: char
    ... TCHAR implicitly facilitates you with the option of compiling in ansi or ... via prepreocessor definition UNICODE because ... One reason for writting apps in plain "char" is that operating systems like ... have a ANSI binary running on 2000 and above, ...
    (microsoft.public.vc.mfc)
  • Re: CAsyncSocket::Reveive() problem
    ... TCHAR is either ANSI or Unicode, ... If TCHAR is wchar_t, then indeed you ARE sending only half of the data; ... Note that there is no reason to use TCHAR pointers, as opposed to CString, CStringA or ...
    (microsoft.public.vc.mfc)
  • Re: char
    ... Your application need to run only on 2000 and above, use UNICODE ... One issue with ansi is that edit controls would allow you a single codepage ... >> TCHAR implicitly facilitates you with the option of compiling in ansi or ... >> preprocessor definition. ...
    (microsoft.public.vc.mfc)
  • Re: Window types
    ... typedef WCHAR TCHAR, * PTCHAR; ... typedef char TCHAR, * PTCHAR; ... Under a Unicode build, ... If the only text your app needs to deal with can be handled with ASCII ...
    (microsoft.public.vc.language)

Loading