views:

60

answers:

0

Hi,

I have some trouble using JNDI since it accepts only 7-bits encoded parameters.

I am trying to change an LDAP entry using JNDI with the following code :

Attribute newattr = new BasicAttribute("userpassword", password);
ModificationItem[] mods = new ModificationItem[1];
mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, newattr);
context.modifyAttributes("uid=anID,ou=People,o=MyOrganisation,c=com", mods);

If my password contains only ascii characters, it works perfectly, but if I use a non-ascii character, like "à", I have this error message :

javax.naming.directory.InvalidAttributeValueException: 
[LDAP: error code 19 - The value is not 7-bit clean: à];

My ldap supports those characters so I guess it comes from JNDI.

Does anyone know how to fix that? Am I supposed to convert my parameter? How can I do that easily?

Thanks