Converting Diactritics (accents) to English Letters [SOLVED]
Posted: Fri Jan 08, 2010 12:33 pm
Hello,
I'm working on a site that contains names with a lot of international characters (such as Sv?tlé Vý?epní). While somebody from the Czech Republic could type this in just fine, the rest of the world may have a little difficulty! Somebody (lets say from america) searching for this item will type in svetle vycepni. Of course this will not return any results.
So what I'm looking to do is have a search table that contains both the standard Sv?tlé Vý?epní as well as Svetle Vycepni.. Unfortunately I can't find any good scripts to convert the special characters into their standard (looking) text counterparts. Can anybody here point me in the right direction as to how I could do this? I know there are a few scripts floating around that do this very thing, but hours of searching has brought me nothing...
Cheers!
Edit: I just wanted to update this thread to say that I'm not using any asian, islamic, etc letters. Everything is pretty limited to letters that are english readable if you remove the accents (sorry I dont know the proper name of these letters).
Scripts such as:
are great for small subsets of the data, but does not cover all of the weird characters I run into (Sv?tlé Vý?epní is a perfect example).
Thanks!
I'm working on a site that contains names with a lot of international characters (such as Sv?tlé Vý?epní). While somebody from the Czech Republic could type this in just fine, the rest of the world may have a little difficulty! Somebody (lets say from america) searching for this item will type in svetle vycepni. Of course this will not return any results.
So what I'm looking to do is have a search table that contains both the standard Sv?tlé Vý?epní as well as Svetle Vycepni.. Unfortunately I can't find any good scripts to convert the special characters into their standard (looking) text counterparts. Can anybody here point me in the right direction as to how I could do this? I know there are a few scripts floating around that do this very thing, but hours of searching has brought me nothing...
Cheers!
Edit: I just wanted to update this thread to say that I'm not using any asian, islamic, etc letters. Everything is pretty limited to letters that are english readable if you remove the accents (sorry I dont know the proper name of these letters).
Scripts such as:
Code: Select all
$title = "Trípode G5";
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$urlTitle = str_replace($search, $replace, $title);Thanks!