title: `ldap_compare` returns false for all attributes/value pairs
body: <p>I am trying to authenticate user via LDAP (active directory). <code>ldap_compare</code> show <code>Warning: ldap_compare(): Compare: Operations error in /mehr/public/lab/lab.php on line 26</code> warning and returns <code>-1</code>. The warning is vague for me. What is wrong with it?</p>
  
  <pre><code>&lt;?php 
  $ldap = ldap_connect("179.33.2.200");
  ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); // Recommended for AD
  ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
  $bind = ldap_bind($ldap, 'admin', '123456');
  
  $bdn = 'DC=active,DC=local';
  $r = ldap_compare($ldap, $bdn, 'userpassword', '123456'); 
  $r = ldap_compare($ldap, $bdn, 'ou', 'bar');  // or evern
  </code></pre>
  
  <h1>Upate:</h1>
  
  <p>Using @Arnold hint I called ldap_compare as follow: </p>
  
  <pre><code>ldap_compare($ldap, $dn, 'ou', mb_convert_encoding('bar','utf16'))
  </code></pre>
  
  <p>Now, I do not get "Operations error" (using <code>utf-16le</code> cause same error.), but now it returns <code>false</code> for all attribute/value pairs. </p>