$text = preg_replace('~\b(\w)(\w+)~e', '"$1".strtolower("$2")', $text);
I was using this function to convert uppercase characters to lowercase (except first character of each word).
It was working fine but now I moved to a new server with the last Php version and this function does not work correctly anymore.
The problem is that it converts all non-english characters into ������
In an older Php version this function just ignored non-english characters and did not replace anything.
Any ideas how to fix it (to force to replace non-english characters or to ignore them)?