Date: 30 de septiembre de 2005 12:52:39 PM GMT-06:00
Subject: Re: ldap national characters problem
On 30/09/2005, at 01:31 AM, Jack Liu wrote:
Hello Claudio,
Yes, you are right.
Finally, I use iconv command to make it worked.
Disply:
$big5replytext = `echo '$mailreplytext[0]' | /usr/bin/iconv -f utf8 -t big5`;
Update:
$utf8replytext = `echo '$newreplytext' | /usr/bin/iconv -f big5 -t utf8`;
Thank you very much.
On 9/30/05, Claudio Jeker <[EMAIL PROTECTED]> wrote: On Fri, Sep 30, 2005 at 03:09:35PM +0800, Jack Liu wrote:
> Hello Claudio,
>
> This is the same way which php function utf8_encode and utf8_decode does.
>
Yes but IIRC you need to utf8_encode and base64_encode the result in php.
The php ldap functions are not very good.
> Still the same problem. I think maybe we should modify qmail-reply.c to make
> the messages body can be decode from LDAP.
>
> How do you think?
>
> > > mailReplyText update function()
> > > $newreplytext = base64_encode($_POST['replytext']);
> > > $add_attribs[$mailreplytext_field] = array("$newreplytext");
> > > $result = ldap_modify($ds,$dn,$add_attribs);
Strange, I use the utf8_encode and utf8_decode functions in PHP and it works without a problem. Never dealt with chinese characters though.
e.g.
$nuevo_texto = utf8_encode($_POST["replytext"]);
if($nuevo_texto != $texto) {
$entry["mailReplyText"] = $nuevo_texto;
if(!ldap_mod_replace($con, $binddn, $entry))
error("vacacion");
display:
$texto = $attrs["mailreplytext"][0];
......
$form_texto = utf8_decode($texto);
Daniel