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?
>

There is no need for that. LDAP passes binary data to qmail-reply and
qmail-reply will not modify the data.

> chuany
>
> On 9/30/05, Claudio Jeker < [EMAIL PROTECTED]> wrote:
> >
> > On Fri, Sep 30, 2005 at 11:53:02AM +0800, Jack Liu wrote:
> > > Dear All,
> > >
> > > I have the same problem on qmail-reply .
> > >
> > > I use php to make a form that can let user use their personal
> > mailreplytext.
> > > But I cannot save chinese word to openldap database. So, I try to use
> > php
> > > function base64_encode() and base64_decode() in my php code.
> > >
> > > Like that:
> > >
> > > mailReplyText update function()
> > > $newreplytext = base64_encode($_POST['replytext']);
> > > $add_attribs[$mailreplytext_field] = array("$newreplytext");
> > > $result = ldap_modify($ds,$dn,$add_attribs);
> > >
> > > User php form
> > > $val1 = @ldap_get_values($ds,$info,$mailreplytext_field);
> > > <textarea rows=8 cols=50 name=replytext>' . base64_decode($val1[0])
> > > .'</textarea>
> > >
> > > This is work for me.
> > >
> > > But, the problem is, qmail-reply send reply email without decode from
> > > base64.
> > >
> > > So, the Sender will see the following messages:
> > >
> > > tPq41Q==
> > >
> > > I know ldap will store the value using UTF8 format.
> > > But, I don't know how to make the Sender recieve the correct reply
> > messages
> > > in chinese word(double bytes).
> > >
> > > Can anybody show me the light?
> >
> > Normaly you have to convert the incomming string (probably UTF-16) to
> > UTF-8. This can be added to LDAP and qmail-reply will do the right thing.
> > qmail-reply uses UTF-8 as default encoding. For other encodings you should
> > have to modify qmail-ldap.h
> >
> > For my scripts I use this stupid perl script to convert the ISO latin1
> > chars to utf8 (I never had to deal with chinese chars):
> >
> > #!/usr/bin/perl
> > use encoding "latin1", STDOUT => "utf8";
> > while(<>){print};
> >
> > There is a man page for encoding installed with perl with some hints on
> > how to use it.
> > --
> > :wq Claudio
> >

--
:wq Claudio



--
:wq chuany

Reply via email to