--- mambo/branches/4.6/includes/mambolanguage.class.php 2007/01/02 19:16:35 861 +++ mambo/branches/4.6/includes/mambolanguage.class.php 2007/01/05 08:17:10 866 @@ -50,7 +50,7 @@ global $page_,$task; $this->updateFiles(); $xml = $this->toXML(); - if( ($page_=="addpage") && ($task=="save") ){ + if( (($page_=="addpage") && ($task=="save")) || ($task=="convert") ){ if (strtolower($this->charset) != 'utf-8') { if(trim($this->wincodepage)!="") $xml = $this->iconvert("utf-8",$this->wincodepage,$xml); @@ -184,19 +184,17 @@ } } $this->codesets = array_unique($this->codesets); - global $mosConfig_absolute_path; - $cvfile = $mosConfig_absolute_path."/includes/ConvertCharset.class.php"; - if(file_exists($cvfile) || function_exists('iconv')) + if( class_exists('ConvertCharset') || function_exists('iconv') ) { - $attrs = get_object_vars($this); - if(trim($this->wincodepage)!="") + if(strtolower($encoding)!="utf-8") { - $this->arrayEncoding($attrs,$this->wincodepage); - $this->bindAttributes($attrs); - - }else{ - if(strtolower($encoding)!="utf-8") + $attrs = get_object_vars($this); + if(trim($this->wincodepage)!="") { + $this->arrayEncoding($attrs,$this->wincodepage); + $this->bindAttributes($attrs); + + }else{ $this->arrayEncoding($attrs,$encoding,TRUE); $this->bindAttributes($attrs); } @@ -218,18 +216,8 @@ return FALSE; } } - global $mosConfig_absolute_path; - $cvfile = $mosConfig_absolute_path."/includes/ConvertCharset.class.php"; - if(file_exists($cvfile)) - { - include_once($cvfile); - $NewEncoding = new ConvertCharset(); - return $NewEncoding->Convert($source,$fromcharset,$tocharset,false); - }else if(function_exists('iconv')) - { - return iconv($fromcharset,$tocharset,$source); - }else - return FALSE; + $NewEncoding = new ConvertCharset(); + return $NewEncoding->Convert($source,$fromcharset,$tocharset,false); } function bindAttributes($attrs) {