2.2 Setting Up for Conversions

Conversion setup consists of the following tasks:

2.2.1 Initializing a Standard Unicode Converter

  1. Call NWUSStandardUnicodeInit.

    On completion, the local system code page converter is set up to convert byte strings to Unicode or Unicode strings to bytes, or to convert the case of Unicode strings.

  2. To initialize a standard converter for a code page other than the system default, call NWUSStandardUnicodeOverride and pass the numeric value of the desired code page for the codepage parameter.

NOTE:Access to global variables initialized with a standard converter can vary according to platform, as explained in Conversion Operations.

When standard conversions are completed, call to NWUSStandardUnicodeRelease to free resources associated with NWUSStandardUnicodeInit or NWUSStandardUnicodeOverride.

For related information, see:

2.2.2 Loading an Extended Unicode Converter

  1. Choose the converter needed for your current task. Choices include the following:

    • Byte/Unicode Converter (Converts byte strings to Unicode and Unicode strings to bytes)
    • Unicode Case Converter (Converts Unicode strings to upper, lower, or title case)
    • Unicode Collation Converter (Assigns collation weights to Unicode strings)
    • Unicode Normalization Converter (Converts Unicode strings between precomposed and decomposed forms)
  2. Choose the options needed for the current operation.

  3. Call the appropriate load function.

  4. Use the converter for the needed operations.

  5. When the converter is no longer needed, free it by calling NWUXUnloadConverter.

For related information, see:

2.2.3 Changing Standard Unicode Converters

  1. Call NWUSStandardUnicodeOverride, passing the numeric value of the desired code page for the codepage. If a standard converter is not currently loaded, NWUSStandardUnicodeOverride initializes the specified code page converter and sets up the global variables for standard Unicode conversions.

NOTE:Access to global variables initialized with a standard converter can vary according to platform, as explained in Conversion Operations.

For related information, see:

2.2.4 Unloading Converters

Standard converters can be initiated multiple times by one or more applications. Each time a converter is initiated, it should be released when conversion operations are complete.

  1. To release a standard converter, call NWUSStandardUnicodeRelease. The function has no parameters.

Extended converters perform a variety of conversions, but each is unloaded in the same way.

  1. To unload an extended converter, call NWUXUnloadConverter and pass the handle of the converter to be unloaded.

For related information, see Initializing/Loading Unicode Converters