Share via


TranslateCharsetInfo

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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.

Syntax

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

Parameters

  • lpSrc
    [in] 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] Bit mask of translation flags, set to one of the values in the following table.

    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 Value

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 Embedded CE are shown in the following table.

Character sets Code pages Font signature bitmaps

ANSI_CHARSET

1252

FS_LATIN1

ARABIC_CHARSET

1256

FS_ARABIC

BALTIC_CHARSET

1257

FS_BALTIC

CHINESEBIG5_CHARSET

950

FS_CHINESETRAD

EASTEUROPE_CHARSET

1250

FS_LATIN2

GB2312_CHARSET

936

FS_CHINESESIMP

GREEK_CHARSET

1253

FS_GREEK

HANGEUL_CHARSET

949

FS_WANSUNG

HEBREW_CHARSET

1255

FS_HEBREW

JOHAB_CHARSET

1361

FS_JOHAB

RUSSIAN_CHARSET

1251

FS_CYRILLIC

THAI_CHARSET

874

FS_THAI

SHIFTJIS_CHARSET

932

FS_JISJAPAN

TURKISH_CHARSET

1254

FS_TURKISH

The table entries are ordered exactly as they are translated. For example, specifying lpSrc as HANGEUL_CHARSET and dwFlags as TCI_SRCCHARSETfills 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.

Requirements

Header wingdi.h
Library coredll.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Unicode Functions
CHARSETINFO
FONTSIGNATURE