You are here: Re: Advice needed; php5, utf-8, mb_* « PHP Programming Language « IT news, forums, messages
Re: Advice needed; php5, utf-8, mb_*

Posted by working_boy on 08/14/07 11:28

On Aug 14, 1:04 pm, Ulf Kadner <dr_lo...@gmx.net> wrote:
> working_...@net.hr wrote:
> > My first, optimistic attempt was to automatically override "ordinary"
> > string functions with its multi-byte versions
> > (.htaccess: php_value mbstring.func_overload 7).
>
> Setting a php_value by htaccess for apache will only work if php runs as
> module. Youre php is used as a module? For LightHttp Webserver it also
> works for CGI. -v please
>
> > But that didn't work out. For example phpmailer class failed.
>
> Failed? Didn't work? Nice description for the problem!
>


There is no need for detail description of the problem with
phpmailer.
I am not asking how to port phpmailer to full UTF-8 php application.
It was just one real-word example.

I am asking about more general advice how to "attack" this problem
with multi-byte strings and third party-libraries. Phpmailer is not
the only class I am using.


Setting php_value works just fine. When func_overload is on multi
byte versions are used instead of "ordinary" string functions.

(I can describe problem with phpmailer when func_overload is on but
this is not really relevant for this thread.

I am sending both html and txt versions of the message in UTF-8.
Func_overload is on. (so php uses mb_strlen instead of strlen , and so
on .. for all string functions which are multi-byte unsafe).

In this scenario html is send like some sort of attachment but since
func_overload is on strlen does not return number of bytes but number
of characters (which is not equal when using UTF-8) so attachments are
not properly sent. So instead of viewing only html or only txt message
I can see (in my e-mail client) both version (html and txt) one below
the other with some damaged headers.

Also there is possibility that strlen is not the only function which
causes this kind of behavior in phpmailer.

When func_overload is off and "ordinary" string functions are used it
SEEMS that phpmailer works fine but I didn't test enough to be sure. )

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация