Victor Gjeset said:
> Hello.
>
> I got a problem with ldapquery plugin. It looks like that it does not
> support utf-8 charset. I am using squirrelmail-1.2.10, and have this in
> configuration file:
> $default_charset          = 'utf-8';
> $ldap_server[0] = array(
>     'charset' => 'utf-8'
> );
>
> we are using retrieveuserdata plugin to get userinformation when they
> log inn, and everything works just fine there. It gets the info from the
> LDAP server and shows all our special chars : ���. But when i use
> ldapquery plugin and ask for info, all our special chars come out wrong.
> I can not see that ldapquery plugin has any kind of configuration that
> can be used to force it to use utf-8. Someone has any ideas how i can
> solve my problem?
>
> Than you in advance
>

Hei

We had exactly the same problem some weeks ago.
pluging/ldapquery/ldapquery.php does not encode/decode to/from utf-8. A
good solution will be to use the same system to encode as in
funtions/abook_ldap_server.php. But until this is done you can do this:

In pluging/ldapquery/ldapquery.php:

IN: function ldapquery_dispresultsSingle ($attributes, $entry, $sortby)

Change:
-------------------------------------------------
default:
         $val = $entry[$i][$attr][$x] . "$<END>";
         for ($token = strtok($val, "\$");
              $token != "<END>"; $token = strtok("\$"))
         {
             print ("$token<BR>");
         }
    }
-------------------------------------------------

With:
-------------------------------------------------
default:
            $val = $entry[$i][$attr][$x] . "$<END>";
            $val = utf8_decode($val);
            for ($token = strtok($val, "\$");
                 $token != "<END>"; $token = strtok("\$"))
            {
                print ("$token<BR>");
            }
      }

-------------------------------------------------

And after all the code in the <form> part:
-------------------------------------------------
print ("</FORM>\n");


   if ($ldq_querystr != "") {
      print ("<H3>Search Results</H3>\n");

      // setup search filter
      //print ("Comparetype is $ldq_comparetype<BR>\n");
      switch ($ldq_comparetype) {
        case "Contains":
-------------------------------------------------

With:
-------------------------------------------------
 print ("</FORM>\n");

    if (($ldq_querystr = utf8_encode($ldq_querystr)) != "") {
      print ("<H3>Search Results</H3>\n");

      // setup search filter
      //print ("Comparetype is $ldq_comparetype<BR>\n");
      switch ($ldq_comparetype) {
         case "Contains":
-------------------------------------------------

That's all

With regards
Rafael Martinez
USIT
University Of Oslo






-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
--
squirrelmail-users mailing list
List Address: [EMAIL PROTECTED]
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to