Browse Source

Also set mb_regex_encoding.

This fixes issues with corrupt bytes when you change the default
encoding and use regular expressions.

Fixes #3800
mark_story 13 years ago
parent
commit
b41051c8ab
1 changed files with 3 additions and 0 deletions
  1. 3 0
      lib/Cake/bootstrap.php

+ 3 - 0
lib/Cake/bootstrap.php

@@ -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')) {