0

When I add a retailer with Turkish character, those Turkish characters are omitted in the URL.

The funciton is;

function friendlyURL($string, $down = 0)

{

$string = preg_replace("`\[.*\]`U","",$string);
$string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$string);
$string = htmlentities($string, ENT_COMPAT, 'utf-8');
$string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string );
$string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $string);


if ($down == 1)
{
    $string = str_replace('-','_',$string);
    return strtolower(trim($string, '_'));
}
else
{
    return strtolower(trim($string, '-'));
}

}

The url for the retailer named "deneme mağazası" is as "domain.com/deneme-ma-azas-site"

How the Turkish characters can be converted?

ctsnr
  • 25
  • 4
  • See http://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net – ChrisF May 26 '13 at 20:29
  • Chris, thanks for the advice. But how can I manage that solution with php for Turkish characters? – ctsnr May 27 '13 at 20:17
  • My mistake - I misread the tags on both questions, but it should point you in the right direction (hopefully) – ChrisF May 27 '13 at 20:18

1 Answers1

0

according to RFC 1738 this is not possible.

here is a reference regarding that http://www.blooberry.com/indexdot/html/topics/urlencoding.htm

happy
  • 474
  • 4
  • 17