ldap_x_utf8_chars

Return the number of UTF-8 characters (not bytes) in a null-terminated UTF-8 string.

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>
  
  ber_len_t ldap_x_utf8_chars (
     const char *p);
  

Parameters

p

(IN) Contains the null-terminated UTF-8 string to count.

Return Values

Number of chars (not bytes) in p.

Example

  /* String with 4 UTF-8 characters */
  char utstr[] = { 0xe2U, 0x98U, 0xa0U, ’a’, ’b’, ’c’, 0 };
  int n = ldap_x_utf8_chars(utstr);     /* Returns 4 */