1
0
mirror of synced 2024-11-25 14:56:09 +03:00

get encoding from default site

This commit is contained in:
m.korolev 2013-11-28 15:42:22 +04:00
parent 5df36eaa5d
commit 5ce54327c2

View File

@ -11,6 +11,7 @@ class ICMLLoader {
public $propertiesProduct;
public $application;
public $encoding = 'utf-8';
public $encodingDefault = 'utf-8';
protected $fp;
protected $mainSection = 1000000;
@ -28,6 +29,9 @@ class ICMLLoader {
$this->isLogged = true;
$defaultSite = CSite::GetList($by="def", $order="desc", Array())->Fetch();
$this->encodingDefault = $defaultSite["CHARSET"];
$this->PrepareSettings();
$this->fp = $this->PrepareFile($this->filename. '.tmp');
@ -79,7 +83,7 @@ class ICMLLoader {
protected function PrepareValue($text)
{
$newText = $this->application->ConvertCharset($text, mb_detect_encoding($text), $this->encoding);
$newText = $this->application->ConvertCharset($text, $this->encodingDefault, $this->encoding);
$newText = strip_tags($newText);
$newText = str_replace("&", "&", $newText);
return $newText;