Hi Pierangelo,

I just can't believe it. I finally sorted this out as of today!

Guess what happened? Although the data was correctly in UTF-8, mysqld
did not return UTF-8, but rather latin-1. Unixodbc got this and just
didn't know what to do with it, and so returned an empty string. Slapd
then sees the blank string and obviously it complains.

So, the problem lied in the communication between unixodbc and MySQL.
Doh! And I was blaming back_sql...

So, sorry for bugging you, and keep up the great work!

Cheers,
Benedikt

On Sun, 2008-06-22 at 20:31 +0200, Benedikt Bär wrote:
> On Sun, 2008-06-22 at 19:18 +0200, Pierangelo Masarati wrote:
> > Benedikt Bär wrote:
> > 
> > > I have a inetOrgPerson set-up in my database. Now, when either the
> > sn
> > > (surname) or givenName (first name) contain special characters,
> e.g.
> > ö ä
> > > ñ, etc.. these attributes will not display.
> > > 
> > > When I manually create a inetOrgPerson in PHPLdapAdmin, these
> > characters
> > > work fine.
> > > 
> > > Slapd gives the following error:
> > > <==backsql_get_attr_vals()
> > > ==>backsql_get_attr_vals(): oc="inetOrgPerson" attr="sn" keyval=4
> > > backsql_get_attr_vals(): number of values in query: 1
> > >
> >
> ==>backsql_get_attr_vals("cn=benedikt,ou=users,ou=employees,dc=rhino-tde,dc=net"):
>  unable to validate value #0 of AttributeDescription sn (21)
> > > <==backsql_get_attr_vals()
> > > ==>backsql_get_attr_vals(): oc="inetOrgPerson" attr="givenName"
> > keyval=4
> > > backsql_get_attr_vals(): number of values in query: 1
> > >
> >
> ==>backsql_get_attr_vals("cn=benedikt,ou=users,ou=employees,dc=rhino-tde,dc=net"):
>  unable to validate value #0 of AttributeDescription givenName (21)
> > > 
> > > However, my database query (I executed it manually), gives back
> the
> > > correct value, in utf8_bin, e.g "Bär".
> > 
> > Probably it's not UTF-8 but another charset.
> 
> Hmmm. According to the CHARSET() function, it is utf8. What charset
> does
> slapd expect?
> 
> Or: How are special characters handled in slapd?
> 
> > 
> > > 
> > > Now, there are two things that could be happening:
> > > 
> > > 1) The charset is not compatible with slapd.
> > > 2) These special characters have to be encoded differently for
> them
> > to
> > > work in slapd.
> > 
> > This is a known issue.  See
> > <http://www.openldap.org/its/?findid=4604>.
> 
> Hmmm. I noticed PMA executes SET_NAMES utf8. Maybe back_sql can be
> configured for this also? (Would it use the MySQL default charset
> anyways?)
> 
> Cheers,
> Benedikt
> 
> > 
> > p.
> > 
> > 
> > Ing. Pierangelo Masarati
> > OpenLDAP Core Team
> > 
> > SysNet s.r.l.
> > via Dossi, 8 - 27100 Pavia - ITALIA
> > http://www.sys-net.it
> > -----------------------------------
> > Office:  +39 02 23998309
> > Mobile:  +39 333 4963172
> > Email:   [EMAIL PROTECTED]
> > -----------------------------------
> > 
> > 
> > ---
> > You are currently subscribed to [EMAIL PROTECTED] as:
> [EMAIL PROTECTED]
> > To unsubscribe send email to [EMAIL PROTECTED] with the word
> > UNSUBSCRIBE as the SUBJECT of the message.

Attachment: signature.asc
Description: This is a digitally signed message part

---
You are currently subscribed to [EMAIL PROTECTED] as: [EMAIL PROTECTED]
To unsubscribe send email to [EMAIL PROTECTED] with the word UNSUBSCRIBE as the 
SUBJECT of the message.

Reply via email to