[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Unicode/UTF-8 support



Kurt

This is what I did:

1. I used the Latin 1 character Capital A with Circumflex.

[clarke] od -tx1 /tmp/latin_1.txt
0000000 c2
0000001
[clarke]

2. I ran it through the libliconv to get UTF-8
[clarke] od -tx1 onechar.utf8
0000000 c3 82
0000002
[clarke]

I hand checked it and I believe that it's correct.

3. I tried to add an inetOrgPerson object with this UTF-8 character as the
value of the manager attribute.  A slapd -d -1 shows:

ldap_read: want=176, got=176
  0000:  02 01 02 68 81 aa 04 21  63 6e 3d 75 74 66 20 38   ...h.ª.!cn=utf 8
  0010:  20 74 65 73 74 2c 20 6f  75 3d 6e 61 62 30 2c 20    test, ou=nab0,
  0020:  6f 3d 61 74 74 2e 63 6f  6d 30 81 84 30 41 04 0b   o=att.com0..0A..
  0030:  6f 62 6a 65 63 74 63 6c  61 73 73 31 32 04 03 74   objectclass12..t
  0040:  6f 70 04 06 70 65 72 73  6f 6e 04 14 6f 72 67 61   op..person..orga
  0050:  6e 69 7a 61 74 69 6f 6e  61 6c 70 65 72 73 6f 6e   nizationalperson
  0060:  04 0d 69 6e 65 74 4f 72  67 50 65 72 73 6f 6e 30   ..inetOrgPerson0
  0070:  12 04 02 63 6e 31 0c 04  0a 75 74 66 20 38 20 74   ...cn1...utf 8 t
  0080:  65 73 74 30 0c 04 02 73  6e 31 06 04 04 74 65 73   est0...sn1...tes
  0090:  74 30 0c 04 02 6f 75 31  06 04 04 6e 61 62 30 30   t0...ou1...nab00
  00a0:  0f 04 07 6d 61 6e 61 67  65 72 31 04 04 02 c3 82   ...manager1.....
ldap_read: want=1 error=Resource temporarily unavailable
conn=0 op=1 ADD dn="CN=UTF 8 TEST,OU=NAB0,O=ATT.COM"
ldap_write: want=41, written=41
  0000:  30 27 02 01 02 69 22 0a  01 15 04 00 04 1b 76 61   0'...i".......va
  0010:  6c 75 65 20 63 6f 6e 74  61 69 6e 73 20 69 6e 76   lue contains inv
  0020:  61 6c 69 64 20 64 61 74  61                                    alid
data


"Kurt D. Zeilenga" wrote:

> At 03:30 PM 3/9/01 -0500, Jim Malcolm wrote:
> >I'm trying to store a UTF-8 value in a 2.0.7 directory using gdbm as the
> >back end.  I gave configure --enable-unicode (I didn't see it defined
> >anywhere but configure didn't complain either).  When I try to do an
> >ldap_add of an object with the UTF-8 string as one of the attribute
> >values, I get
>
> Are you sure you provided a valid UTF-8 string?  A common
> mistake is to provide UCS-2 or UCS-4 instead of UTF-8.
>
> >initial ldap_add_s: Invalid syntax
> >initial ldap_add_s: additional info: value contains invalid data
> >
> >(The initial ldap_add_s: is a string I supplied to ldap_perror().)
> >
> >The same program works when I aim it at a Netscape LDAP server.  Any
> >suggestions?
>
> Check your input (by hand).

--
Jim Malcolm
Room 2A19
180 Park Ave.
Florham Park, NJ  07932-0971
973 236 6469
jimm@att.com
AOL IM jimmyato