Re: Re: Removing nonlatin characters

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

 



Documented research indicate that on Fri, 1 Jul 2005 13:58:23 +0300, Dotan
Cohen wrote:

> On 6/29/05, Rene Brehmer <plasticbunny@xxxxxxxxxxxxxx> wrote:
> I think you mean something like this:
> 
> function stripAccents($string) {
>   $returnString = strtr($string,
>       'àáâãäçèéêëìíîïñòóôõöšùúûüýÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖŠÙÚÛÜÝ',
> 'aaaaaceeeeiiiinooooosuuuuyAAAAACEEEEIIIINOOOOOSUUUUY');
>   $returnString =
> str_replace('æ','ae',str_replace('Æ','AE',$returnString));
>   $returnString =
> str_replace('ø','oe',str_replace('Ø','OE',$returnString));
>   $returnString = str_replace('ß','ss',$returnString);
>   return $returnString;
> }
> 
> This function is part using code once posted on this list, part my own
> creation.

Thank you Rene. Does this approach have any special advantages over
recode_string?

I have no idea ... I've never used recode_string, I didn't even know it
existed ... When I started doing PHP, it was with ver. 4.2.0. I believe
recode_string is something that came with 4.3.0 or thereabout.

I used that function for only one project, where I kept the original
strings in one field in the database, and then had a stripped version of
the same in different fields, for the sole purpose to being able to control
sorting when running on Windows (Windows stinks at sorting text correctly,
especially when you use Scandinavian regional settings ... it assumes
wildly and there's no proper understanding of how we alphabetize in
Scandinavia). On Linux, sorting is much better, and I've never had to make
special columns just for sorting... (FWIW: MySQL and probably several other
DB systems, adapt their sorting methods from the host OS).

-- 
Rene Brehmer
aka Metalbunny

We have nothing to fear from free speech and free information on the
Internet, but pop-up advertising! 

http://metalbunny.net/
My little mess of things...

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