Platform SDK: International Features

TranslateCharsetInfo

The TranslateCharsetInfo function translates based on the specified character set, code page, or font signature value, setting all members of the destination structure to appropriate values.

BOOL TranslateCharsetInfo(
  DWORD *lpSrc,        // information
  LPCHARSETINFO lpCs,  // character set information
  DWORD dwFlags        // translation option
);

Parameters

lpSrc
[in/out] If dwFlags is TCI_SRCFONTSIG, this parameter is the address of the fsCsb member of a FONTSIGNATURE structure. Otherwise, this parameter is a DWORD value.
lpCs
[out] Pointer to a CHARSETINFO structure that receives the translated character set information.
dwFlags
[in] Specifies how to perform the translation. This parameter can be one of the following values.
Value Meaning
TCI_SRCCHARSET Source contains the character set value in the low word, and zero in the high word.
TCI_SRCCODEPAGE Source is a code-page identifier in the low word and zero in the high word.
TCI_SRCFONTSIG Source is the code-page bitfield portion of a FONTSIGNATURE structure. On input this should have only one Windows code-page bit set, either for an ANSI code-page value or for a common ANSI and OEM value (for OEM values, bits 32-63 must be clear.). On output this will have only one bit set.

If the TCI_SRCFONTSIG value is given, the lpSrc parameter must be the address of the code-page bitfield. If any other TCI_ value is given, the lpSrc parameter must be a value not an address.


Return Values

If the function succeeds, it returns a nonzero value.

If the function fails, it returns zero. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Wingdi.h; include Windows.h.
  Library: Use Gdi32.lib.

See Also

Unicode and Character Sets Overview, Unicode and Character Set Functions, CHARSETINFO, FONTSIGNATURE