TranslateCharsetInfo

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

At a Glance

Header file: Wingdi.h
Windows CE versions: 2.10 and later

Syntax

UINT TranslateCharsetInfo( DWORD FAR *lpSrc,
LPCHARSETINFO lpCs, DWORD dwFlags );

Parameters

lpSrc

[in] Either a long pointer to a code page bitfield or a value as defined by the dwFlags parameter. If dwFlags is TCI_SRCFONTSIG, this parameter is the address of the fsCsb member of a FONTSIGNATURE structure. Otherwise, this parameter is a 32-bit value.

lpCs

[out] Long pointer to a CHARSETINFO structure that receives the translated character set information.

dwFlags

[in] Specifies a bitmask of translation flags. It is one of the following values:

Value Description
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, you set one bit. Choose from the ANSI range (bits 0-15), the combined ANSI and OEM range (bits 16-31), or the OEM range (bits 32-63). On output, the structure has only one bit set.
If the TCI_SRCFONTSIG value is given, the lpSrc parameter must be the address of the code-page bit field. If any other TCI_* value is given, the lpSrc parameter must be a value not an address.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

OEM code pages are not supported.

Character sets, code pages, and font signature bitmaps supported by Windows CE are listed in the following table.

Character Sets Code Pages Font Signature Bitmaps
ANSI_CHARSET 1252 FS_LATIN1
SHIFTJIS_CHARSET 932 FS_JISJAPAN
HANGEUL_CHARSET 949 FS_WANSUNG
JOHAB_CHARSET 1361 FS_JOHAB
GB2312_CHARSET 936 FS_CHINESESIMP
CHINESEBIG5_CHARSET 950 FS_CHINESETRAD
HEBREW_CHARSET 1255 FS_HEBREW
ARABIC_CHARSET 1256 FS_ARABIC
GREEK_CHARSET 1253 FS_GREEK
TURKISH_CHARSET 1254 FS_TURKISH
BALTIC_CHARSET 1257 FS_BALTIC
EASTEUROPE_CHARSET 1250 FS_LATIN2
RUSSIAN_CHARSET 1251 FS_CYRILLIC
THAI_CHARSET 874 FS_THAI

The table entries are ordered exactly as they are translated. For example, specifying lpSrc as HANGEUL_CHARSET and dwFlags as TCI_SRCCHARSET fills CHARSETINFO with HANGEUL_CHARSET, code page 949, and FS_WANSUNG. Specifying lpSrc as code page 936 and dwFlags as TCI_SRCCODEPAGE fills CHARSETINFO with GB2312_CHARSET, code page 936, and FS_CHINESESIMP.

On output, the fsUSB and fsCsb members of the FONTSIGNATURE structure—specified by the fs member of the CHARSETINFO structure—are zero-filled before setting the returned code-page bitfield value.

See Also

CHARSETINFO