RAD Studio
ContentsIndex
PreviousUpNext
Unicode for C++

This section contains Unicode related feature topics for C++.

Name 
Description 
TCHAR, which is declared in the header file tchar.h, is a typedef (alias) that maps either to char or to wchar_t. When you want to write portable code, you should use TCHAR instead of hard coding char or wchar_t.
The TCHAR maps to option controls the floating definition of _TCHAR. Your choices are:
_TCHAR Mapping Options  
This topic describes how to write portable code that correctly uses the floating definitions of RTL functions. The list of floating functions is useful for choosing the correct variant of a function. 
C++ has a unique set of Unicode-related issues that Delphi users do not have. Some of these issues are:
  • String constants, such as "string constant", are still narrow (char*), so you cannot pass them to VCL functions that take PChar as you did before. If you prefix the constant with L, as in L"string constant", you can pass the constant to VCL functions with a PChar parameter.
  • The C++ RTL is as wide and narrow as it always was. Unless you planned ahead and used <tchar.h> and the _txxxxxx() macros, you need to do some... more 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!