XZ Utils
5.2.8
|
Calculate width of a multibyte string. More...
Functions | |
size_t | tuklib_mbstr_width (const char *str, size_t *bytes) |
Get the number of columns needed for the multibyte string. More... | |
Calculate width of a multibyte string.
size_t tuklib_mbstr_width | ( | const char * | str, |
size_t * | bytes | ||
) |
Get the number of columns needed for the multibyte string.
This is somewhat similar to wcswidth() but works on multibyte strings.
str | String whose width is to be calculated. If the current locale uses a multibyte character set that has shift states, the string must begin and end in the initial shift state. |
bytes | If this is not NULL, *bytes is set to the value returned by strlen(str) (even if an error occurs when calculating the width). |