Internationalization and localization tools


Multibyte Character Function

size_t _mbclen(const unsigned char *c);

size_t _tclen(const _TXCHAR *c);

Internationalization (I18n) Function Overview

The _mbclen function returns returns 1 or 2, depending on whether the multibyte character c is one or two bytes long. There is no error return; if c does not point to the lead byte of a multibyte character, the result of _mbclen is unpredictable.

As this function pertains only to multibyte characters, there is no wide version of _mbclen. Instead, the Generic _tclen function maps to 1 when the _UNICODE flag is set and to _mbclen when the _MBCS compiler flag is set.

I18n Issues

Use the appropriate version of the function as required for internationalization support, noting the following:

The _mbclen function depends on the multibyte code page in effect. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. Use _getmbcp and _setmbcp to query or change the current multibyte code page, respectively.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Multibyte Character Functions

 

Lingoport internationalization and localization services and software