LDAP Search Filters Using with non-standard Characters

Overview#

RFC 4511 describes Lightweight Directory Access Protocol (LDAP) The Protocol and clearly shows the SearchRequest LDAP SearchFilter is to be, as with all data sent to the DSA, " be encoded for exchange using the Basic Encoding Rules BER of ASN.1 with" a few restrictions.

So even though "Some applications may find it useful to have a common way of representing these search filters in a human-readable form.", the DUA (LDAP Client) is responsible to perform the encoding as described in Lightweight Directory Access Protocol (LDAP) The Protocol (RFC 4511).

Our Recommendation#

The best way to create any kind of filter in an LDAP-enabled application is to use the Filter.create* methods (from the UnboundID LDAP SDK For Java) instead of trying to construct a filter yourself using the LDAP String Representation of Search Filters.

This is true for two reasons:

More Information#

There might be more information for this subject on one of the following: