title: Java LDAP search cant seem to handle spaces
body: <p>When calling javax.naming.ldap.InitialLdapContext's search() method, passing in the DN...</p>
  
  <pre><code>OU=User Structure, OU=Acecity(LTO), OU=AceCloud,OU=Hosting, DC=AceCloud,DC=local
  </code></pre>
  
  <p>The error is outputted is <code>Authentication failed. failed to authenticate user:[LDAP: error code 32 - 0000208D: NameErr: DSID-0315270B, problem 2001 (NO_OBJECT), data 0.</code></p>
  
  <pre><code>LdapName baseDN = new LdapName(baseDN
  NamingEnumeration results = ctx.search(baseDN, "("+ identity.getBindAttribute() + "=" + acctname + ")", sc);
  </code></pre>
  
  <p>The problem occurs due to the space in <code>User Structure</code>. When I placed the users in another OU that doesn't contain a space, I am able to authenticate fine. I’ve tried all of the following:</p>
  
  <pre><code>OU=User\ Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User\20Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User\\20Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User%Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User\ Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User\\ Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  OU=User\\\\ Structure, OU=Acecity(LTO), OU=AcecityCloud,OU=Hosting, DC=AcecityCloud,DC=local
  </code></pre>
  
  <p>None works. Any ideas?</p>