The Function mb_Internal_Encoding in PHP
The mbstring extension gives PHP multibyte-specific string functions and handles character encoding conversion between the possible encoding pairs. mb_internal_encoding sets the internal character encoding used by mbstring. It is not used by any other function and does not affect the character encoding utilized in HTTP input or output.
mb_internal_encoding has been EXPERIMENTAL since PHP 4.4.0. This means that the behavior of this function (and in fact, ANYTHING documented here) may change in a future release without notification.
If you use mb_internal_encoding to set your own internal character encoding and then later upgrade to a version of PHP that does not support that encoding, it is likely that the PHP interpreter will raise an error when it encounters a string that it cannot encode properly. This is especially a problem for multibyte string functions such as mb_strtolower($str).
To prevent this from happening, make sure that your scripts are using a valid encoding. You can test if your script is using the right encoding by checking for the mb_detect_encoding() function. This will return the mb_internal_encoding for your script. If this is not UTF-8, you should rebuild your server with mbstring and check the mb_internal_encoding setting again. Also, you should move any header sending code before the mb_detect_encoding() call. This will prevent PHP from trying to send headers after it has already written them to the output stream. This would result in an E_WARNING. The most common causes of this E_WARNING are whitespace or new lines after the