Multibyte character string termination
Some APIs that use ITLocale assume that character strings are terminated with a null character, while others assume that a string consists of a pointer and length indicating the number of bytes in the string. ITLocale methods can be used in both cases.
Multibyte character strings are passed to ITLocale methods
in two arguments:
const char *s
specifies a multibyte string.int nbytes
specifies the length of the string.
The actual argument names might vary.
If nbytes is
the value ITLocale::ScanToNul
, the method treats s as
a null-terminated string. Otherwise, the method assumes s contains nbytes bytes.
The
terminator of a null-terminated string is a single byte whose value
is 0
. Multibyte character strings that are not null-terminated
might contain null characters, but these characters do not indicate
the end of the string.