It's very bad style to write "oe" instead of "ö" within a text/heading. What do you think about this way to have human readable URLs and correct orthography. And you can add any other conversion-rules ("/" -> "-", ":-)" -> " " ...) I think it's a smart solution to handle both - 1 byte and 2 byte (or more) conversion
1) add this two lines to language file:
(for example de.php):
Code:
$tx['urlchars']['before']="ß,ä,ö,ü,Ä,Ö,Ü,/";
$tx['urlchars']['after']="ss,ae,oe,ue,Ae,Oe,Ue,-";
(or for example gr.php):
Code:
$tx['urlchars']['before']="α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,ς,τ,υ,φ,χ,ψ,ω,ά,έ,ή,ί,ϊ,ΐ,ό,ύ,ϋ,ΰ,ώ,
Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,¶,Έ,Ή,Ί,Ϊ,Ό,Ύ,Ϋ,Ώ";
$tx['urlchars']['after']="a,b,g,d,e,z,h,q,i,k,l,m,n,j,o,p,r,s,s,t,y,f,x,c,w,a,e,
h,i,i,i,o,u,u,u,w,A,B,G,D,E,Z,H,Q,I,K,L,M,N,J,O,P,R,S,T,Y,F,X,C,W,A,E,H,I,I,O,U,U,W";
2) add this function to cms.php:
Code:
function iso2ascii($text)
{
global $tx;
$array1 = explode(",",$tx['urlchars']['before']);
$array2 = explode(",",$tx['urlchars']['after']);
// Check the array and return original URL if conversion-array is wrong. (Incorrect edited by user)
if (count($array1)<>count($array2))
{return $text;}
// Change chars
$text = str_replace($array1,$array2,$text);
// lowercase (optional)
$text = strtolower($text);
return $text;
}
3) find and modify function uenc($s) in cms.php
from:
Code:
function uenc($s){return str_replace('+','_',urlencode($s));}
to:
Code:
function uenc($s){return str_replace('+','_',urlencode(iso2ascii($s)));}
But there is one problem: Changing the URLs of an existing webproject will break all indexed links (on other websites and searchengines)!!!
Greets Flo