ldap_x_utf8_charlen2

Return the number of bytes in a UTF-8 character, while catching shortest possible illegal UTF-8 encoding.

Library:*ldapsdk.*
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap_utf8.h>
  
  int ldap_x_utf8_charlen2 (
     const char *p);
  

Parameters

p

(IN) Points to the UTF-8 character.

Return Values

Returns length in bytes of the UTF-8 character. (1-6). 0 is returned for an invalid character.

Remarks

The length of the character is determined by looking only at the first byte of the UTF-8 character.