From f26783ab3a3e8635a6dfa0ee9d3c7e188b6d4f9f Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Sun, 2 May 2010 21:40:37 +0200 Subject: [PATCH] PHPExcel : IBM AIX iconv() does not work --- libraries/PHPExcel/PHPExcel/Shared/String.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/PHPExcel/PHPExcel/Shared/String.php b/libraries/PHPExcel/PHPExcel/Shared/String.php index e165fdd63..bdd8b3faf 100644 --- a/libraries/PHPExcel/PHPExcel/Shared/String.php +++ b/libraries/PHPExcel/PHPExcel/Shared/String.php @@ -122,9 +122,13 @@ class PHPExcel_Shared_String // we cannot use iconv when that happens // Also, sometimes iconv_substr('A', 0, 1, 'UTF-8') just returns false in PHP 5.2.0 // we cannot use iconv in that case either (http://bugs.php.net/bug.php?id=37773) + // CUSTOM: IBM AIX iconv() does not work if (function_exists('iconv') && @iconv('UTF-8', 'UTF-16LE', 'x') - && @iconv_substr('A', 0, 1, 'UTF-8') ) { + && @iconv_substr('A', 0, 1, 'UTF-8') + && !(defined('PHP_OS') && @stristr(PHP_OS, 'AIX') + && defined('ICONV_IMPL') && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) + && defined('ICONV_VERSION') && (@strcasecmp(ICONV_VERSION, 'unknown') == 0))) { self::$_isIconvEnabled = true; } else {