Process characters
A GLS locale supports a specific code set, which can contain single-byte characters and multibyte characters.
When your application processes only single-byte characters, it can perform string-processing tasks based on the assumption that the number of bytes in a buffer equals the number of characters that the buffer can hold. For single-byte code sets, you can rely on the built-in scaling for array allocation and access that the C compiler provides.
If your application processes multibyte characters, however, it can no longer assume that the number of bytes in a buffer equals the number of characters in the buffer. Because of the potential of varying number of bytes for each character, you can no longer rely on the C compiler to perform character-processing tasks such as traversing a multibyte-character string and allocating sufficient space in memory for a multibyte-character string.
You can use functions from the library to communicate to your application how to perform globalization on character-processing tasks.
- String traversal
- String processing
- Character classification
- Case conversion
- Character comparison and sorting