3 ms·
No, PHP is moving away from functions which have never worked properly on Unicode input at all: > But even if the user did want natural language case conversio
by duskwuff 5y ago
No, PHP is moving away from functions which have never worked properly on Unicode input at all:
> But even if the user did want natural language case conversion, they would be unlikely to achieve success with strtolower(). This is because it processes the string one byte at a time, feeding each byte to the C library's tolower(). If the input is UTF-8, by far the most popular modern choice, strtolower() will mangle the string, typically producing invalid UTF-8 as output.
There are other functions which actually work for Unicode-aware case conversion, like mb_strtolower() or mb_convert_case().