ULSQueryAttr
Appearance
Description
Queries whether or not a character has the specified character attribute.
Arguments
ULSQueryAttr( char, attribute [, codepage] [, locale] )
Parameters:
char The character to query. This must be a valid character for the specified codepage. This may be a multi-byte string if the codepage allows multiple bytes per character; however, if the string contains more than one valid character, only the first one will be considered (the remainder are ignored).
attribute The name of the attribute to check for. Must be one of the following. (Attributes whose names start with "_" represent Unicode character sets. Those starting with "#" are BIDI attributes.) The name is not case sensitive.
alnum Alphabetic and numeric characters alpha Letters and linguistic marks ascii Standard ASCII character blank Space and tab characters cntrl Control and format characters digit Digits 0 through 9 graph All except controls and space lower Lower case alphabetic character number Integral numbers between 0 and 9 print Everything except control characters punct Punctuation marks space Whitespace and line-breaking characters symbol Symbol upper Upper case alphabetic character xdigit Hexadecimal digits (0-9, a-f, A-F) diacritic Diacritic mark fullwidth Full-width variant halfwidth Half-width variant hiragana Hiragana character ideograph Kanji/Han character kashida Arabic tatweel (elongation character) katakana Katakana character nonspacing Non-spacing mark nsdiacritic Non-spacing diacritic nsvowel Non-spacing vowel vowelmark Vowel mark _apl APL character _arabic Arabic character _arrow Arrow character _bengali Bengali character _bopomofo Bopomofo character _box Box or line drawing character _currency Currency Symbol _cyrillic Cyrillic character _dash Dash character _devanagari Devanagari character _dingbat Dingbat _fraction Fraction value _greek Greek character _gujarati Gujarati character _gurmukhi Gurmukhi character _hanguel Hangul Jamo character _hebrew Hebrew character _hiragana Hiragana character set _katakana Katakana character set _lao Laotian character _latin Latin character _linesep Line separator _math Math symbol _punctstart Punctuation start _punctend Punctuation end _tamil Tamil character _telegu Telegu character _thai Thai character _userdef User defined character #arabicnum Arabic numbers #blocksep Block separator #commonsep Common separator #euronum European number #eurosep European separator #euroterm European terminator #left Left to right text orientation #mirrored Symmetrical text orientation #neutral Other neutral #right Right to left text orientation #whitespace Whitespace
codepage The source codepage (a positive integer). This is the codepage with which <string> is encoded (i.e. under which it would display correctly). The default is the current process codepage.
locale The name of the locale whose text-attribute rules are to be used. Locale names are usually of the form "xx_YY", where "xx" is a language and YY is a country (e.g. "en_US", "zh_TW", "it_IT", etc.) The default is to use the current locale as defined by the LANG and LC_* environment variables.
Returns
This function returns 1 if the character has the specified attribute, or 0 if it does not. If an error occurs during the query operation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.