I am trying to set up PHP's Transliterator
class, to convert some strings which have characters in the range of utf-8, to simple [a-z] characters, but I am having trouble in figuring out how to use it.
I have set up my code exactly like this answer https://stackoverflow.com/a/13019489/2691879 yet the echoes return only empty strings.
(Here's the code part from that answer, if you don't want to click the link:)
$str1 = 'Orléans'
$str2 = 'Angoulême'
$rule = 'NFD; [:Nonspacing Mark:] Remove; NFC';
$transliter = Transliterator::create($rule);
echo $transliter->transliterate($str1);
echo $transliter->transliterate($str2);
I googled for like an hour now, but can't find how to correctly set up the rules, neither anyone with a simmilar problem to mine.
If I replace the special characters from the two strings, with [a-z] representation, the transliterator echoes them out.
Why are the two echo statements returning an empty string? How could I achieve my desired result?