get encoding from default site
This commit is contained in:
parent
5df36eaa5d
commit
5ce54327c2
@ -11,6 +11,7 @@ class ICMLLoader {
|
|||||||
public $propertiesProduct;
|
public $propertiesProduct;
|
||||||
public $application;
|
public $application;
|
||||||
public $encoding = 'utf-8';
|
public $encoding = 'utf-8';
|
||||||
|
public $encodingDefault = 'utf-8';
|
||||||
|
|
||||||
protected $fp;
|
protected $fp;
|
||||||
protected $mainSection = 1000000;
|
protected $mainSection = 1000000;
|
||||||
@ -28,6 +29,9 @@ class ICMLLoader {
|
|||||||
|
|
||||||
$this->isLogged = true;
|
$this->isLogged = true;
|
||||||
|
|
||||||
|
$defaultSite = CSite::GetList($by="def", $order="desc", Array())->Fetch();
|
||||||
|
$this->encodingDefault = $defaultSite["CHARSET"];
|
||||||
|
|
||||||
$this->PrepareSettings();
|
$this->PrepareSettings();
|
||||||
|
|
||||||
$this->fp = $this->PrepareFile($this->filename. '.tmp');
|
$this->fp = $this->PrepareFile($this->filename. '.tmp');
|
||||||
@ -78,12 +82,12 @@ class ICMLLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function PrepareValue($text)
|
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 = strip_tags($newText);
|
||||||
$newText = str_replace("&", "&", $newText);
|
$newText = str_replace("&", "&", $newText);
|
||||||
return $newText;
|
return $newText;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function PrepareFile($filename)
|
protected function PrepareFile($filename)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user