Url Romanization Issues

171 Views Asked by At

I am using Xenforo forum script. for non english character on threads title, there is a function converting non english character to english character.

whenever I post "ö" is converting to "oe". but functions array is;

$title = strtr($title, array(
    '"' => '',
    "'" => '',
    "Ö" => "o",
    "ö" => "o",
    "C" => "c",
    "c" => "c",
    "Ğ" => "g",
    "ğ" => "g",
    "Ş" => "s",
    "ş" => "s",
    "Ü" => "u",
    "ü" => "u",
    "İ" => "i",
    "ı" => "i",
    "Ç" => "c",
    "ç" => "c",
    "é" => "i",
    "â" => "a",
    "Ê" => "e",
    "Â" => "a",
    "?" => "_",
    "*" => "_",
    "." => "_",
    "," => "_",
    ";" => "_",
    ")" => "_",
    "(" => "_",
    "{" => "_",
    "}" => "_",
    "[" => "_",
    "]" => "_",
    "!" => "_",
    "+" => "_",
    "%" => "_",
    "&" => "_",
    "#" => "_",
    "$" => "_",
    "=" => "_",
    "ê" => "e",
    "." => "-"
    ));

why "ö" character is converting to "oe"? I wanna "ö" as "o".

2

There are 2 best solutions below

1
On

You can use your own replacement for certain characters:

$title = str_replace("ö","o",$title);

In this case you should comment out the code that you have posted so that

ö

is not changed into

oe

before your replacing function gets called.

0
On

I found other file about romanization.... there is UTF-8 Case lookup table file.