Re: utf-8-safe replacement for strtr()?
| From: | Tom Worster | Date: | Tue, 24 Mar 2009 12:15:35 +0000 |
| Subject: | Re: utf-8-safe replacement for strtr()? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290633@lists.php.net to get a copy of this message | ||
On 3/23/09 2:02 PM, "Tom Worster" <fsb@thefsb.org> wrote:
> i havea general replacement or workaround for every php function in my code
> that i know to be utf-8-unsafe. except one: strtr().
strtr() with three parameters is certainly unsafe. but my tests are showing
that it may be ok with two parameters if the strings in the second parameter
are well formed utf-8.
does anyone know more? can confirm or contradict?
> the only ideas i have to implement strtr in php with known utf-8-safe php
> functions would be rather inefficient.
my replacement for the 3-param strtr is an order of magnitude less unlovely
to behold than my replacement for the 2-param version
> any ideas, suggestions, pointers? or maybe you're better at googling an
> answer than i am. assume mbstring is available.