This fixes issues with corrupt bytes when you change the default encoding and use regular expressions. Fixes #3800
@@ -174,6 +174,9 @@ if (function_exists('mb_internal_encoding')) {
if (!empty($encoding)) {
mb_internal_encoding($encoding);
}
+ if (!empty($encoding) && function_exists('mb_regex_encoding')) {
+ mb_regex_encoding($encoding);
+ }
if (!function_exists('mb_stripos')) {