From 50a74db5bceacf45e49dda6b778bc13a89fb2bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=8F=AF?= Date: Wed, 10 Aug 2016 13:45:21 +0900 Subject: [PATCH] Fix: ConvertEncoding method try order Changed try order from [1st:iconv, 2nd:mbstring] to [1st:mbstring, 2nd:iconv] just like comment --- Classes/PHPExcel/Shared/String.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/PHPExcel/Shared/String.php b/Classes/PHPExcel/Shared/String.php index fa1a64e05..b7b8c7591 100644 --- a/Classes/PHPExcel/Shared/String.php +++ b/Classes/PHPExcel/Shared/String.php @@ -486,14 +486,14 @@ public static function UTF8toBIFF8UnicodeLong($value) */ public static function ConvertEncoding($value, $to, $from) { - if (self::getIsIconvEnabled()) { - return iconv($from, $to, $value); - } - if (self::getIsMbstringEnabled()) { return mb_convert_encoding($value, $to, $from); } + if (self::getIsIconvEnabled()) { + return iconv($from, $to, $value); + } + if ($from == 'UTF-16LE') { return self::utf16_decode($value, false); } elseif ($from == 'UTF-16BE') {