• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accentuated characters in url

#2
[eluser]xwero[/eluser]
Are you saying the get global accepts accented characters but path info doesn't? Could i see your solution?

I think it's better to transliterate the urls because people who don't speak the language but who want to navigate through the site are not going to know where to place the accents.

Transliterating is easy using the strtr function and to make it language aware you could extend the url helper with following function
Code:
function url_transliterate($str,$lang)
{
   $western = array('ä'=>'a','à'=>a,'á'=>'a','â'=>'a'); // and so on
   $fr = array_merge($western,array('ç'=>'c'));
   $de = array_merge($western,array('ß'=>'ss')); // i'm not sure the character is readable for everyone but in German it's called Eszett.
   return strtr($str,${$lang});
}


Messages In This Thread
Accentuated characters in url - by El Forum - 06-25-2008, 01:47 AM
Accentuated characters in url - by El Forum - 06-25-2008, 02:33 AM
Accentuated characters in url - by El Forum - 06-25-2008, 03:20 AM
Accentuated characters in url - by El Forum - 06-25-2008, 03:41 AM
Accentuated characters in url - by El Forum - 09-05-2008, 08:56 AM
Accentuated characters in url - by El Forum - 09-05-2008, 09:15 AM
Accentuated characters in url - by El Forum - 09-05-2008, 09:26 AM
Accentuated characters in url - by El Forum - 09-05-2008, 09:49 AM
Accentuated characters in url - by El Forum - 09-05-2008, 10:05 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.