Determines the number of multibyte character string display columns.
Note: The mbswidth subroutine is specific to this manufacturer. It is not defined in the POSIX, ANSI, or X/Open standards. Use of this subroutine may affect portability.
#include <mbstr.h>
int mbswidth ( MbString, Number)
const char *MbString;
size_t Number;
The mbswidth subroutine determines the number of display columns required for a multibyte character string.
MbString | Contains a multibyte character string. |
Number | Specifies the number of bytes to read from the s parameter. |
The mbswidth subroutine returns the number of display columns that will be occupied by the MbString parameter if the number of bytes (specified by the Number parameter) read from the MbString parameter form valid multibyte characters. If the MbString parameter points to a null character, a value of 0 is returned. If the MbString parameter does not point to valid multibyte characters, -1 is returned. If the MbString parameter is a null pointer, the behavior of the mbswidth subroutine is unspecified.
This subroutine is part of Base Operating System (BOS) Runtime.
The wcswidth subroutine, wcwidth subroutine.
National Language Support Overview for Programming in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.