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

Re: Rejected NLS in DN



> Hi.
>
> I'm running openLDAP 2.1.22 (pre-compiled) on Linux (SuSE 9.0).
>
> I'm trying to insert an entry with Norwegian national characters in the
> DN. This is rejected by the server. I thought national languages were
> supported through UTF-8. Below is the sys-message from the server:
> --------------
> Apr 12 20:45:43 shamash slapadd: bdb_initialize: Sleepycat Software: \
> Berkeley DB 4.1.25: (September 23, 2003)
> Apr 12 20:45:43 shamash slapadd: str2entry: entry -1 has invalid DN \
> "cn=Jørgen Åstad,dc=Salg,dc=plainjoe,dc=org"
> ----------------
>
> Can I do this or do I have to rewrite the names of employees?

AFAIK OpenLDAP's DN handling code is "perfectly" LDAPv3 compliant, i.e. it
supports UTF-8 as required by the specifications.  Of course, you need to
provide valid UTF-8 strings; apparently, you're using strings in some
other national encoding.  Try something like iconv(1) and iconv(3) for
shell and programmatical conversion of strings, or use any scripting
facilities (e.g. perl).

e.g.

slapdn "`echo 'cn=Jørgen Åstad,dc=Salg,dc=plainjoe,dc=org'|iconv -t UTF8`"
DN: <cn=JÃ?rgen Ã
stad,dc=Salg,dc=plainjoe,dc=org> check succeeded
normalized: <cn=j�rgen åstad,dc=salg,dc=plainjoe,dc=org>
pretty:     <cn=JÃ?rgen Ã
stad,dc=Salg,dc=plainjoe,dc=org>

(except from looking pretty ugly on a terminal) does pretty fine;

slapdn "`echo 'cn=Jørgen Åstad,dc=Salg,dc=plainjoe,dc=org'|iconv -t UTF8`"
2>&1|od -c
0000000   D   N   :       <   c   n   =   J   Ã   ?   r   g   e   n
0000020   Ã 205   s   t   a   d   ,   d   c   =   S   a   l   g   ,   d
0000040   c   =   p   l   a   i   n   j   o   e   ,   d   c   =   o   r
0000060   g   >       c   h   e   c   k       s   u   c   c   e   e   d
0000100   e   d  \n   n   o   r   m   a   l   i   z   e   d   :       <
0000120   c   n   =   j   Ã   ?   r   g   e   n       Ã   ¥   s   t   a
0000140   d   ,   d   c   =   s   a   l   g   ,   d   c   =   p   l   a
0000160   i   n   j   o   e   ,   d   c   =   o   r   g   >  \n   p   r
0000200   e   t   t   y   :                       <   c   n   =   J   Ã
0000220   ?   r   g   e   n       Ã 205   s   t   a   d   ,   d   c   =
0000240   S   a   l   g   ,   d   c   =   p   l   a   i   n   j   o   e
0000260   ,   d   c   =   o   r   g   >  \n
0000271

does even better.

p.

>
> regards
> Kjell-Einar


-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it