From b41051c8ab64e11d90c8daee2389a569c6360f35 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 30 Apr 2013 12:51:49 -0400 Subject: [PATCH] Also set mb_regex_encoding. This fixes issues with corrupt bytes when you change the default encoding and use regular expressions. Fixes #3800 --- lib/Cake/bootstrap.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php index f4469ccbe..228145b34 100644 --- a/lib/Cake/bootstrap.php +++ b/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')) {