-1

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".

Pavlo
  • 43,301
  • 14
  • 77
  • 113
ahmetlutfu
  • 325
  • 2
  • 9
  • 2
    What is your question? – Rob Aug 19 '13 at 08:38
  • why "ö" is not converting according to array? I wanna "ö" as "o". – ahmetlutfu Aug 19 '13 at 08:41
  • THen you should give more information: what language do you use (PHP?), is the code part of a framework, what does your code look like? It is hard to say what's going wrong without that. – Rob Aug 19 '13 at 08:43
  • xenforo is based on php. – ahmetlutfu Aug 19 '13 at 08:46
  • 1
    You are missing roughly 10000 other characters that would need transliteration. Go for a more general approach like http://stackoverflow.com/questions/3542717/how-to-transliterate-accented-characters-into-plain-ascii-characters – deceze Aug 19 '13 at 09:05
  • as Robert stated in his answer, use that to replace "ö" with "o" and then call your your function – ajt Aug 19 '13 at 09:05

2 Answers2

1

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.

Rob
  • 11,492
  • 14
  • 59
  • 94
0

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

ahmetlutfu
  • 325
  • 2
  • 9