Internationalization and localization tools


Multibyte Character Manipulation Function

void _mbccpy(unsigned char *dest, const unsigned char *src);

void _tccpy(TCHAR *dest, const TCHAR char *src);

Internationalization (I18n) Function Overview

The _mbccpy function copies one multibyte character from src to dest, using the LC_CTYPE category of the current locale. An implicit call is made to _ismbblead to ensure that src points to the lead byte of a multibyte character; otherwise, no copy is performed.

_tccpy is the Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _mbccpy or a simple inline function or macro.

There is no wide version of this function per se, since in that case a simple assignment statement will suffice, as shown below.

I18n Issues

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

Prior to calling _mbccpy or _tccpy on MBCS platforms, ensure that the locale is set correctly, since the function depends on the locale's LC_CTYPE category setting.

In addition the implicit _ismbblead call 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.

There is no wide version of this function per se. For the wide character (wchar_t) version of this function, use the following assignment statement: (*dest = *src;).

Recommended Replacements*

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

Multibyte Character Manipulation Functions

 

Lingoport internationalization and localization services and software