2.5 Case, Collation, and Normalization Conversion

The following sections explain how to convert the case of the Unicode string:

2.5.1 Converting Unicode String Case with a Standard Converter

  1. If you have not already done so, call NWUSStandardUnicodeInit.

  2. Supply a buffer of sufficient length to receive the lower or upper case Unicode string.

  3. Call NWUSUnicodeToLowerCase or NWUSUnicodeToUpperCase for the actual conversion.

    • For the lowerCaseOutput or upperCaseOutput parameter, pass a pointer to the output buffer.
    • For the outputBufferLen parameter, pass a pointer to the length of the output buffer.
    • For the unicodeInput parameter, pass a pointer to the Unicode string input buffer.
  4. After all standard Unicode conversion operations are completed, call NWUSStandardUnicodeRelease.

2.5.2 Converting Unicode String Case with an Extended Converter

  1. If you have not already done so, call NWUXLoadCaseConverter to initialize the converter and obtain a converter handle.

    NOTE:You must specify the case to which the converter is to convert in the caseFlag parameter of NWUXLoadCaseConverter. If an initialized converter is not set to the desired case, initialize another case converter. It is possible to have multiple converters, each set to a different option (upper case, lower case, title case).

  2. Supply a buffer of sufficient size to hold the output monocased Unicode string. In some languages, changing the case of a string may change the string length.

  3. Call NWUXUnicodeToCase with the following parameter stipulations:

    • For the caseHandle parameter, pass the handle returned from appropriate call to NWUXLoadCaseConverter.
    • For the monocaseOutput parameter, pass the address of the output buffer for the Unicode monocase string.
    • For the outputBufferLen parameter, pass the length of the output buffer.
    • For the unicodeInput parameter, pass a pointer to the input string buffer.
  4. Use the monocased output string as needed.

  5. When the converter is no longer needed, call NWUXUnloadConverter, passing the handle returned when the converter was loaded.

For related information, see Standard and Extended Unicode Converter Functions.