GetStringTypeA

(LCID, dwInfoType, lpSrcStr, cchSrc, lpCharType)
LCID LCID
DWORD dwInfoType
LPCSTR lpSrcStr
int cchSrc
LPWORD lpCharType

Parameters

LCID

Locale context for the mapping. The string is assumed to be represented in the default ANSI code page for this locale.

dwInfoType

Type of character information to retrieve. The various types are divided into different levels (see Comments for a list of the information included in each type). The options are mutually exclusive. The following types are supported:

  • CT_CTYPE1

  • CT_CTYPE2

  • CT_CTYPE3

lpSrcStr

String for which character types are requested. If cchSrc is pics/OLE00090001.gif1, lpSrcStr is assumed to be null-terminated.

cchSrc

Character count of lpSrcStr. If cchSrc is pics/OLE00090001.gif1, lpSrcStr is assumed to be null-terminated. Note that this must also be the character count of lpCharType.

lpCharType

Array of the same length as lpSrcStr (cchSrc). On output, the array contains one word corresponding to each character in lpSrcStr.

Return Value

Value
Meaning
0
Failure

Success

Comments

The lpSrcStr and lpCharType pointers may not be the same; in this case the error ERROR_INVALID_PARAMETER results.

The character type bits are divided up into several levels. One level's information can be retrieved by a single call.

This function supports three character types:

  • Ctype 1

  • Ctype 2

  • Ctype 3

Ctype 1 types support ANSI C and POSIX character typing functions. A bitwise OR of these values is returned when dwInfoType is set to CT_CTYPE1. For DBCS locales, the Ctype 1 attributes apply to both the narrow characters and the wide characters. The Japanese hiragana and katakana characters, and the kanji ideograph characters all have the C1_ALPHA attribute.

The following table lists the Ctype 1 character types.

Name
Value
Meaning
C1_UPPER
  1. x0001
Uppercase1
C1_LOWER
  1. x0002
Lowercase1
C1_DIGIT
0x0004
Decimal digits
C1_SPACE
0x0008
Space characters
C1_PUNCT
0x0010
Punctuation
C1_CNTRL
0x0020
Control characters
C1_BLANK
0x0040
Blank characters
C1_XDIGIT
0x0080
Hexadecimal digits
C1_ALPHA
0x0100
Any letter
  1. The Windows version 3.1 functions IsCharUpper and IsCharLower do not always produce correct results for characters in the range 0x80-0x9f, so they may produce different results than this function for characters in that range. (For example, the German Windows version 3.1 language driver incorrectly reports 0x9a, lowercase s hacek, as uppercase).

Ctype 2 types support the proper layout of text. For DBCS locales, Ctype 2 applies to both narrow and wide characters. The directional attributes are assigned so that the BiDi layout algorithm standardized by Unicode produces the correct results. See The Unicode Standard: Worldwide Character Encoding from Addison-Wesley for more information on the use of these attributes.


Name
Value
Meaning
Strong
C2_LEFTTORIGHT
  1. x1
Left to right

C2_RIGHTTOLEFT
  1. x2
Right to left
Weak
C2_EUROPENUMBER
  1. x3
European number, European digit

C2_EUROPESEPARATOR
  1. x4
European numeric separator

C2_EUROPETERMINATOR
  1. x5
European numeric terminator

C2_ARABICNUMBER
  1. x6
Arabic number

C2_COMMONSEPARATOR
  1. x7
Common numeric separator
Neutral
C2_BLOCKSEPARATOR
  1. x8
Block separator

C2_SEGMENTSEPARATOR
  1. x9
Segment separator

C2_WHITESPACE
  1. xA
White space

C2_OTHERNEUTRAL
  1. xB
Other neutrals
Not applicable
C2_NOTAPPLICABLE
0x0
No implicit direction (for example, control codes)

Ctype 3 types are general text-processing information. A bitwise OR of these values is returned when dwInfoType is set to CT_CTYPE3. For DBCS locales, the Ctype 3 attributes apply to both the narrow characters and the wide characters. The Japanese hiragana and katakana characters and the kanji ideograph characters all have the C3_ALPHA attribute.

Name
Value
Meaning
C3_NONSPACING
  1. x1
Nonspacing mark
C3_DIACRITIC
  1. x2
Diacritic nonspacing mark
C3_VOWELMARK
0x4
Vowel nonspacing mark
C3_SYMBOL
0x8
Symbol
C3_KATAKANA
0x10
Katakana character
C3_HIRAGANA
0x20
Hiragana character
C3_HALFWIDTH
0x40
Narrow character
C3_FULLWIDTH
0x80
Wide character
C3_IDEOGRAPH
0x100
Ideograph
C3_ALPHA
0x8000
Any letter
C3_NOTAPPLICABLE
0x0
Not applicable

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database