Home | Unicode Tasks | Multibyte Character Set (MBCS) Tasks
Use the following tips:
sz1++;
becomes
sz1 = _mbsinc( sz1 );
The _mbsinc and _mbsdec functions correctly increment and decrement in character units, regardless of the character size.
sz2--;
becomes
sz2 = _mbsdec( sz2Head, sz2 );
Alternatively, your “head” pointer could be to a valid character in the string, such that
sz2Head < sz2
You must have a pointer to a known valid lead byte.
See Also Byte Indices