I found a function in MediaWiki Source, which converts a string with umlauts to HEX format.
Now i want to convert the formated string back to the string with umlauts.
The function:
$Umlaut = "löschen";
$out = preg_replace_callback("/([\\xc0-\\xff][\\x80-\\xbf]*)/",'stripForSearchCallback', $Umlaut);
function stripForSearchCallback( $matches ) {
return 'u8' . bin2hex( $matches[1] );
}
echo $out;
Output: "lu8c3b6schen"
Now i want to convert "lu8c3b6schen" back to "löschen".
How can i do this please?
chr(hexdec())as callback.[a-z0-9], but you have an uneven format8c3b6. Maybe I'm missing something ? Also notice that a regex would most likely mess your sentence for example if you have numbers in itlöschen 65or consecutive hex letters: acce nt