2011-06-15, 04:15:26
Zegnåt Wrote:mvlcek Wrote:These strings would be UTF-8, thus all languages are supported. The transliteration function would need to split the string with mb_substr (or similar) to create the arrays needed for strtr (or whatever). As this splitting is only done when saving pages, there is no performance hit.(Emphasis mine.)
Spitting is exactly the problem, take the following example:
The array works and will transliterate æ to ae and ß to ss. The strings will not work, they will turn æ into a (swapping the first characters) and ß into r (swapping the third characters). There is no way to teach a string splitter when 2 characters might go together.Code:...
'TRANSLITERATION' => array('æ'=>'ae','ê›'=>'r','ß'=>'ss'),
'TRANSLIT_FROM' => 'æêݧ',
'TRANSLIT_TO' => 'aerss',
...
OK, didn't think about replacing one character by multiple ones. You could of course use a comma-separated string like:
Code:
'TRANSLIT_FROM' => 'æ,ê›,ß',
'TRANSLIT_TO' => 'ae,r,ss',