From: Bertrand C. <ber...@fr...> - 2004-11-10 14:22:15
|
Hi, I wasn't able to find a function to escape chars in DN strings, so I wrote this one (based on escape_filter_chars): def escape_dn_chars(s): s =3D s.replace('\\', r'\5C') s =3D s.replace(',', r'\2C') s =3D s.replace('=3D', r'\3D') s =3D s.replace('+', r'\2B') return s Feel free to use/modify it in python-ldap (license: PSFL, as python-ldap) --=20 Bertrand Croq - FreesKop - Avenue Robert Schuman - 35170 BRUZ (France) http://www.freeskop.com/ - Tel: 02 99 05 04 56 - Fax: 02 99 05 96 40 |