3

我正在使用 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); 


}
4

1 回答 1

2

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

Modify => Properties page => Title / Encoding => Clear => Include Unicode Signature (BOM)
于 2014-02-21T16:26:35.677 回答