Jump to content

ULSTransform: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
==Description==
Transforms a string according to one of the predefined transformation types. The effect of this transformation may vary by locale.
Transforms a string according to one of the predefined transformation types. The effect of this transformation may vary by locale.


==Arguments==
==Arguments==
ULSTransform( string, xform [, codepage] [, locale] )
ULSTransform( string, xform [, codepage] [, locale])


Parameters:
===Parameters===
      string   The string to be converted (required).
;string:The string to be converted (required).
 
;xform:The name of the transformation to apply (required). Must be one of the following (not case sensitive):
      xform     The name of the transformation to apply (required). Must be
:lower - Transform so that all text is lowercase. Characters without lowercase forms (as defined by the locale) are left unchanged.
                one of the following (not case sensitive):
:upper - Transform so that all text is uppercase. Characters without uppercase forms (as defined by the locale) are left unchanged.
 
:compose - Transform so that all diacritical (e.g. accented) characters are represented using fully-composed forms (a single code element represents the combined character).
                  lower     Transform so that all text is lowercase. Characters
:decompose - Transform so that all diacritical characters are represented using decomposed forms (separate code elements are used to represent the base character and the diacritical mark).
                            without lowercase forms (as defined by the locale)
:hiragana - Transform so that all Japanese phonetic characters use the Hiragana character set.
                            are left unchanged.
:katakana - Transform so that all Japanese phonetic characters use the full-width Katakana character set.
 
:kana - Transform so that all Japanese phonetic characters use the half-width Katakana character set.
                  upper     Transform so that all text is uppercase. Characters
;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.
                            without uppercase forms (as defined by the locale)
;locale:The name of the locale whose transformation 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.
                            are left unchanged.
 
                  compose   Transform so that all diacritical (e.g. accented)
                            characters are represented using fully-composed
                            forms (a single code element represents the combined
                            character).
 
                  decompose Transform so that all diacritical characters are
                            represented using decomposed forms (separate code
                            elements are used to represent the base character
                            and the diacritical mark).
 
                  hiragana Transform so that all Japanese phonetic characters
                            use the Hiragana character set.
 
                  katakana Transform so that all Japanese phonetic characters
                            use the full-width Katakana character set.
 
                  kana     Transform so that all Japanese phonetic characters
                            use the half-width Katakana character set.
 
      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 transformation 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==
==Returns==
The transformed string, which is in the same codepage as the input string.
The transformed string, which is in the same codepage as the input string. If an error occurs during transformation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.
If an error occurs during transformation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.


[[Category:The OS/2 API Project]]
[[Category:RxULS]]

Latest revision as of 14:46, 14 August 2017

Transforms a string according to one of the predefined transformation types. The effect of this transformation may vary by locale.

Arguments

ULSTransform( string, xform [, codepage] [, locale])

Parameters

string
The string to be converted (required).
xform
The name of the transformation to apply (required). Must be one of the following (not case sensitive):
lower - Transform so that all text is lowercase. Characters without lowercase forms (as defined by the locale) are left unchanged.
upper - Transform so that all text is uppercase. Characters without uppercase forms (as defined by the locale) are left unchanged.
compose - Transform so that all diacritical (e.g. accented) characters are represented using fully-composed forms (a single code element represents the combined character).
decompose - Transform so that all diacritical characters are represented using decomposed forms (separate code elements are used to represent the base character and the diacritical mark).
hiragana - Transform so that all Japanese phonetic characters use the Hiragana character set.
katakana - Transform so that all Japanese phonetic characters use the full-width Katakana character set.
kana - Transform so that all Japanese phonetic characters use the half-width Katakana character set.
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 transformation 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

The transformed string, which is in the same codepage as the input string. If an error occurs during transformation, an empty string ("") is returned and the global ULSERR variable will be set to a non-zero value.