Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6II18n::mbrlen ( const P6CHAR pSrc,
P6UINT32  srcSize,
mbstate_t *  pMbs,
P6UINT32 pResultSize 
)
pure virtual

Get number of bytes in a (possibly multi-byte) character.

Calling this function is equivalent to the following code sequence:

* mbstate_t internal;
* mbrtowc( NULL, pSrc, srcSize, pMbs == NULL ? &internal : pMbs );
*

If pMbs is a null pointer, the mbrlen() function uses its own internal mbstate_t object, which is initialised at program startup to the initial conversion state. Otherwise, the mbstate_t object pointed to by pMbs is used to describe the current conversion state of the associated character sequence.

For UTF8 encoded strings the caller can use the utf8ToWcs and utf8ToWc functions directly.

Parameters
pSrc[ in ] Pointer to a (multi-byte) character string.
srcSize[ in ] The number of bytes of data pointed to by pSrc to count.
pMbs[ in ] Pointer to the current conversion state
pResultSize[ out ] Pointer to where the length of the character string pSrc is written.
Returns
SuccessP6R::eOk 
FailureP6R::eFailAn encoding error occurs where the next n or fewer bytes do not contribute to a complete and valid character.
P6R::eNotInitializedA successful call to initialize was not made before this call.