--- mambo/branches/4.6/includes/mambolanguage.class.php 2006/12/08 11:45:58 811 +++ mambo/branches/4.6/includes/mambolanguage.class.php 2006/12/08 12:18:23 812 @@ -46,15 +46,16 @@ if (isset($this->$var)) $this->$var = $value; } function save() { + global $page_; $this->updateFiles(); - $xml = $this->toXML(); - - if (strtolower($this->charset) != 'utf-8') { - if (function_exists('iconv')) { - $xml = iconv("utf-8", $this->charset, $xml); - } - } + if($page_ == "addpage"){ + if (strtolower($this->charset) != 'utf-8') { + if (function_exists('iconv')) { + $xml = iconv("utf-8", $this->charset, $xml); + } + } + } /**/ $fp = fopen($this->path . $this->getFileName() . '.xml', 'w+'); fwrite($fp, $xml); @@ -175,11 +176,28 @@ } } $this->codesets = array_unique($this->codesets); - + $this->attrEncoding($encoding); return true; } return false; } + function attrEncoding($encoding) + { + $attrs = get_object_vars($this); + foreach($attrs as $key=>$var) + { + if(is_array($var)) + { + $arrs = &$this->$key; + foreach($arrs as $k=>$v) + { + $arrs[$k] = iconv("utf-8",$encoding,$v); + } + }else + $this->$key = iconv("utf-8",$encoding,$var); + } + } +