Re: utf-8-safe replacement for strtr()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/23/09 2:02 PM, "Tom Worster" <fsb@xxxxxxxxxx> 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.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux