Windows A(SCII) or W(ide) API and Tcl

Most Windows API calls which accept strings are available in an ASCII or Wide versions, which differ as follows [L1 ]:

Windows NameC data typeCommand SuffixParameter FormatPreprocessor define
ANSIcharABytes in the system encoding (ex: cp1252)_MBCS
Widewchar_tWUTF-16 Unicode_UNICODE

TCL Core

Windows 95/98/ME only had the ANSI interface. TCL 8.5.x still supports to compile on that theoretically but (as Jan said) nobody is trying that any more.

TCL 8.6.x requires the wide interface and thus internally mostly uses the wide methods.

TCL API

Within the TCL API, there is some help for this issue. The type "TCHAR" is defined as a char when compiled for ANSI and wchar_t otherwise.

The api helper functions Tcl_WinUtfToTChar and Tcl_WinTCharToUtf allow to convert from TCL internal encoding to Windows TCHAR. See the man page of Tcl_Encoding for explanations