]> git.sur5r.net Git - openldap/commitdiff
Add IA5StringConvert (to UCS-2/4). May not be needed if we use
authorKurt Zeilenga <kurt@openldap.org>
Thu, 27 Jan 2000 01:02:51 +0000 (01:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 27 Jan 2000 01:02:51 +0000 (01:02 +0000)
UTF-8 internally.

servers/slapd/schema.c

index da518d5ca1d901367b003d338e111e981a573b39..9913f128804c40402998725b417c3921aad639f9 100644 (file)
@@ -922,6 +922,25 @@ IA5StringValidate(
        return 0;
 }
 
+static int
+IA5StringConvert(
+       Syntax *syntax,
+       struct berval *in,
+       struct berval **out )
+{
+       struct berval *bv = ch_malloc( sizeof(struct berval) );
+       bv->bv_len = (in->bv_len+1) * sizeof( ldap_unicode_t );
+       bv->bv_val = ch_malloc( bv->bv_len );
+
+       for(i=0; i < val->bv_len; i++ ) {
+               /*
+                * IA5StringValidate should have been called to ensure
+                * input is limited to IA5.
+                */
+               bv->bv_val[i] = in->bv_val[i];
+       }
+}
+
 static int
 IA5StringNormalize(
        Syntax *syntax,