8000 switched to use mbstring whenever possible instead of iconv · symfony/symfony@e193452 · GitHub
[go: up one dir, main page]

Skip to content

Commit e193452

Browse files
committed
switched to use mbstring whenever possible instead of iconv
1 parent dd0da03 commit e193452

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Component/Templating/PhpEngine.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,10 @@ function ($value) use ($that)
507507
*/
508508
public function convertEncoding($string, $to, $from)
509509
{
510-
if (function_exists('iconv')) {
511-
return iconv($from, $to, $string);
512-
} elseif (function_exists('mb_convert_encoding')) {
510+
if (function_exists('mb_convert_encoding')) {
513511
return mb_convert_encoding($string, $to, $from);
512+
} elseif (function_exists('iconv')) {
513+
return iconv($from, $to, $string);
514514
}
515515

516516
throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');

src/Symfony/Component/Yaml/Unescaper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ public function unescapeCharacter($value)
134134
*/
135135
private function convertEncoding($value, $to, $from)
136136
{
137-
if (function_exists('iconv')) {
138-
return iconv($from, $to, $value);
139-
} elseif (function_exists('mb_convert_encoding')) {
137+
if (function_exists('mb_convert_encoding')) {
140138
return mb_convert_encoding($value, $to, $from);
139+
} elseif (function_exists('iconv')) {
140+
return iconv($from, $to, $value);
141141
}
142142

143143
throw new \RuntimeException('No suitable convert encoding function (install the iconv or mbstring extension).');

0 commit comments

Comments
 (0)
0