From c6b0e24a456d19092b47d9296fdd739b8899cded Mon Sep 17 00:00:00 2001
From: Alexander Makarov <sam@rmcreative.ru>
Date: Sat, 29 Nov 2014 01:29:15 +0300
Subject: [PATCH] Fixes #6305: `yii\i18n\Formatter::asParagraphs()` was not unicode-aware

---
 framework/CHANGELOG.md       | 1 +
 framework/i18n/Formatter.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md
index 046c0b5..2b32f78 100644
--- a/framework/CHANGELOG.md
+++ b/framework/CHANGELOG.md
@@ -207,6 +207,7 @@ Yii Framework 2 Change Log
 - Bug #5049: `ActiveForm::validationDelay` should be applied to user types only (qiangxue)
 - Bug #5055: Fixed `yii\console\controllers\CacheController` does not check if cache component instance of 'yii\caching\Cache' (klimov-paul)
 - Bug #5126: Fixed text body and charset not being set for multipart mail (nkovacs)
+- Bug #6305: `yii\i18n\Formatter::asParagraphs()` was not unicode-aware (samdark)
 - Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
 - Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
 - Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)
diff --git a/framework/i18n/Formatter.php b/framework/i18n/Formatter.php
index 7c990fb..63d4b8f 100644
--- a/framework/i18n/Formatter.php
+++ b/framework/i18n/Formatter.php
@@ -322,7 +322,7 @@ class Formatter extends Component
         if ($value === null) {
             return $this->nullDisplay;
         }
-        return str_replace('<p></p>', '', '<p>' . preg_replace('/\R{2,}/', "</p>\n<p>", Html::encode($value)) . '</p>');
+        return str_replace('<p></p>', '', '<p>' . preg_replace('/\R{2,}/u', "</p>\n<p>", Html::encode($value)) . '</p>');
     }
 
     /**
--
libgit2 0.27.1