Jump to content

ULSTransform: Difference between revisions

From EDM2
Created page with "==Description== Transforms a string according to one of the predefined transformation types. The effect of this transformation may vary by locale. ==Arguments== ULSTransform..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
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):
: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.


      xform    The name of the transformation to apply (required).  Must be
==Returns==
                one of the following (not case sensitive):
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.
 
                  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
[[Category:RxULS]]
                            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.

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.