| 50 |
global $page_,$task; |
global $page_,$task; |
| 51 |
$this->updateFiles(); |
$this->updateFiles(); |
| 52 |
$xml = $this->toXML(); |
$xml = $this->toXML(); |
| 53 |
if( ($page_=="addpage") && ($task=="save") ){ |
if( (($page_=="addpage") && ($task=="save")) || ($task=="convert") ){ |
| 54 |
if (strtolower($this->charset) != 'utf-8') { |
if (strtolower($this->charset) != 'utf-8') { |
| 55 |
if(trim($this->wincodepage)!="") |
if(trim($this->wincodepage)!="") |
| 56 |
$xml = $this->iconvert("utf-8",$this->wincodepage,$xml); |
$xml = $this->iconvert("utf-8",$this->wincodepage,$xml); |
| 184 |
} |
} |
| 185 |
} |
} |
| 186 |
$this->codesets = array_unique($this->codesets); |
$this->codesets = array_unique($this->codesets); |
| 187 |
global $mosConfig_absolute_path; |
if( class_exists('ConvertCharset') || function_exists('iconv') ) |
| 188 |
$cvfile = $mosConfig_absolute_path."/includes/ConvertCharset.class.php"; |
{ |
| 189 |
if(file_exists($cvfile) || function_exists('iconv')) |
if(strtolower($encoding)!="utf-8") |
| 190 |
{ |
{ |
| 191 |
$attrs = get_object_vars($this); |
$attrs = get_object_vars($this); |
| 192 |
if(trim($this->wincodepage)!="") |
if(trim($this->wincodepage)!="") |
| 195 |
$this->bindAttributes($attrs); |
$this->bindAttributes($attrs); |
| 196 |
|
|
| 197 |
}else{ |
}else{ |
|
if(strtolower($encoding)!="utf-8") |
|
|
{ |
|
| 198 |
$this->arrayEncoding($attrs,$encoding,TRUE); |
$this->arrayEncoding($attrs,$encoding,TRUE); |
| 199 |
$this->bindAttributes($attrs); |
$this->bindAttributes($attrs); |
| 200 |
} |
} |
| 216 |
return FALSE; |
return FALSE; |
| 217 |
} |
} |
| 218 |
} |
} |
|
global $mosConfig_absolute_path; |
|
|
$cvfile = $mosConfig_absolute_path."/includes/ConvertCharset.class.php"; |
|
|
if(file_exists($cvfile)) |
|
|
{ |
|
|
include_once($cvfile); |
|
| 219 |
$NewEncoding = new ConvertCharset(); |
$NewEncoding = new ConvertCharset(); |
| 220 |
return $NewEncoding->Convert($source,$fromcharset,$tocharset,false); |
return $NewEncoding->Convert($source,$fromcharset,$tocharset,false); |
|
}else if(function_exists('iconv')) |
|
|
{ |
|
|
return iconv($fromcharset,$tocharset,$source); |
|
|
}else |
|
|
return FALSE; |
|
| 221 |
} |
} |
| 222 |
function bindAttributes($attrs) |
function bindAttributes($attrs) |
| 223 |
{ |
{ |