Codeigniter xml_from_result输出奇怪的字符“'╗┐'”

时间:2013-02-04 13:08:07

标签: php xml codeigniter character-encoding

我正在使用codeigniter框架 任何输出我有这个字符“'''”

  

// config.php

     

$ config ['charset'] ='UTF-8';

我的印刷品 http://web.wipix.com.br/Capturar.PNG

/* Model */
public function AllVotos()
{
$this->load->dbutil();          

$select = $this->db->query("SELECT SUM(voto = '0') as insatisfatorio,   SUM(voto = '1') as bom, SUM(voto = '2') as excelente FROM qr_wiplay_participacoes ");

$config = array (
            'root'    => 'root',
            'element' => 'element',
            'newline' => "\n",
            'tab'     => "\t"
           );

return $this->dbutil->xml_from_result($select, $config);
}



/* Controller */

public function AllVotos(){

$xml = $this->home_model->AllVotos();

$this->output->set_content_type('text/xml');

$this->output->set_output($xml); 


}

1 个答案:

答案 0 :(得分:2)

这是因为文件带有BOM签名 使用您的编辑器删除签名 Dreamweaver

Modify => Properties page => Title / Encoding => Clear => Include Unicode Signature (BOM)