Quote:
Originally Posted by Dean C
Well I noticed on castlecops you still have the foreign chars in the actual URI's. My problem with that is that no-one showed me evidence that these chars are actually valid in a URI. I've changed a lot since then but I used this function to convert foreign chars to their english equivalent:
PHP Code:
// function to replace foreign chars with their english equivalent
function remove_accents($text)
{
$trans = get_html_translation_table(HTML_ENTITIES);
foreach($trans as $literal =>$entity)
{
if(ord($literal) >= 192)
{
$replace[] = substr($entity, 1, 1);
$search[] = $literal;
}
}
return str_replace($search, $replace, $text);
}
|
You need to take a look at IRIs and the URI-> IRI mapping (international resource identifier).