According to the PHP website it does this:
encoding is the character encoding name used for the HTTP input character encoding conversion, HTTP output character encoding conversion, and the default character encoding for string functions defined by the mbstring module. You should notice that the internal encoding is totally different from the one for multibyte regex.
Can someone please explain this in simpler terms?
- HTTP input character encoding conversion
- HTTP output character encoding conversion
- default character encoding for string functions
- What is meant by “internal encoding is totally different from the one for multibyte regex”?
My guess is that
- means GET and POST are treated as that encoding.
- means it outputs to that encoding.
- means it uses that encoding for all multibyte string functions.
- I have no idea about. Why would regex be different to normal string functions?
If point 2 is correct would you need to do:
ini_set('default_charset', 'UTF-8');
If I understand 3 correctly does that mean if you do:
mb_internal_encoding('UTF-8')
You don't need to do:
mb_strtolower($str, 'UTF-8');
Just:
mb_strtolower($str);
I did read on another SO post that mb_strtolower($str) should no be trusted and that you need to set the encoding for each multibyte string function. Is this true?