Internationalization and localization tools


Wide Character String Operation

int wcswidth(const wchar_t *pwcs, size_t n);

Internationalization (I18n) Function Overview

The wcswidth() function determines the number of column positions required for n wide-character codes (or fewer than n wide-character codes if a null wide-character code is encountered before n wide-character codes are exhausted) in the string pointed to by pwcs.

If a non-printable wide-character code for the current locale is encountered, -1 is returned.

I18n Issues

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

Ensure that the current locale is set properly.

There is no ANSI multibyte UTF-8 version of this function. UTF-8 strings however can be converted to wide characters (wchar_t) and then wcswidth can be used.

Recommended Replacements*

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

Wide Character String Operations

 

Lingoport internationalization and localization services and software