String encodings
On Microsoft Windows, string functions have an ANSI (8-bit) variant without a suffix and a wide-character Unicode variant with a trailing W.
On Unix builds, the functions without a suffix use UTF-8 strings; W variants are not available. Function names with a trailing T select the appropriate variant:
Microsoft Windows without
_UNICODEdefined: ANSI variant without a suffix.Microsoft Windows with
_UNICODEdefined: Unicode W variant.Unix builds: UTF-8 variant without a suffix; leave
_UNICODEundefined.
Use the T names for portable calls. Do not #define _UNICODE on Unix builds.
T names are preprocessor aliases, not additional runtime functions. There are no separate A-suffixed variants in this public header.
Examples
-
Passing a string
TFormer_SetPrinterNameTselects TFormer_SetPrinterName on Windows without_UNICODEand on Unix, or TFormer_SetPrinterNameW on Windows with_UNICODE. -
Returning a string
TFormer_GetPrintResultTselects TFormer_GetPrintResult on Windows without_UNICODEand on Unix, or TFormer_GetPrintResultW on Windows with_UNICODE.