From c67359ce94107c2921b4d8443d3080e264b3e9bd Mon Sep 17 00:00:00 2001 From: "m.korolev" Date: Thu, 14 Nov 2013 15:53:26 +0400 Subject: [PATCH] bugfix encoding ICML loading --- intaro.intarocrm/classes/general/ICMLLoader.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICMLLoader.php b/intaro.intarocrm/classes/general/ICMLLoader.php index 103dc239..20e08d5b 100644 --- a/intaro.intarocrm/classes/general/ICMLLoader.php +++ b/intaro.intarocrm/classes/general/ICMLLoader.php @@ -11,7 +11,6 @@ class ICMLLoader { public $propertiesProduct; public $application; public $encoding = 'utf-8'; - public $defaultCharset = null; protected $fp; protected $mainSection = 1000000; @@ -29,9 +28,6 @@ class ICMLLoader { $this->isLogged = true; - $this->defaultCharset = LANG_CHARSET; - - $this->PrepareSettings(); $this->fp = $this->PrepareFile($this->filename. '.tmp'); @@ -83,10 +79,7 @@ class ICMLLoader { protected function PrepareValue($text) { - if ($this->defaultCharset === "") - $this->defaultCharset = mb_detect_encoding($text); - - $newText = $this->application->ConvertCharset($text, $this->defaultCharset, $this->encoding); + $newText = $this->application->ConvertCharset($text, mb_detect_encoding($text), $this->encoding); $newText = strip_tags($newText); $newText = str_replace("&", "&", $newText); return $newText;