Name

wcswidth - determine columns needed for a fixed-size wide character

Library

libc.lib

Synopsis

  #include <wchar.h>
  int wcswidth (const wchar_t *pwcs, size_t n);

Return values

The wcswidth function returns 0 if pwcs is an empty string (L""), -1 if a non-printing wide character is encountered, otherwise it returns the number of column positions occupied.

Detailed description

The wcswidth function determines the number of column positions required for the first n characters of pwcs, or until a null wide character (L’\0’) is encountered.

The behavior of the wcswdith is affected by LC_CTYPE category of the current locale.


Examples

#include <wchar.h>
/* Illustrates how to use wcswidth API */
int example_wcswidth()
{  
  /* wide character string for which width has to */
  /* determined */
  wchar_t *ws1 = L"test case";
  int retval;
  /* compute the width of the ws1 */
  retval = wcswidth(ws1,50);
 /* return the result */
  return retval;
}

         


Limitations

The current implementation of wcswidth is dependent on the locale support of SYMBIAN. It doesn’t work for the locales which the SYMBIAN doesn’t support.

See also

iswprint, wcwidth
The wcswidth function conforms to -p1003.1-2001.

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top