The XformObject type is used to control text transformations.

The UniCreateTransformObject creates an XformObject for the specified transformation type, according to the rules of a particular locale.

The transformation type is specified as a UniChar string; the standard types are:

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, meaning that a single code element represents the combined character.
decompose
Transform so that all diacritical characters are represented using decomposed forms, meaning that separate code elements are used to represent the base character and the diacritical mark(s).
hiragana
Transform so that all Japanese phonetic characters use the Hiragana character set.
katakana
Transform so that all Japanese phonetic characters use the Katakana character set.
kana
Transform so that all Japanese phonetic characters use the half-width Katakana character set.

Other transformation types may be defined by specific locales.

An XformObject should be freed using using UniFreeTransformObject once it is no longer needed.

UniTransformStr

The conversion is performed by calling the UniTransformStr function. This function takes the following parameters:

If the function returns successfully, the transformed text is placed into the output buffer. The input length value will be modified to contain the number of characters read from the input string, and the output length value will contain the total number of characters placed in the output buffer.

Note that the input and output string lengths will not necessarily be the same, particularly when using the compose and decompose transformation types. You should ensure that the output buffer is large enough to hold the transformed text.


[Back] [Next]