我有一个UTF-8的问题。我使用框架Codeigniter。对于客户端,我必须 将CSV文件转换为数据库。但是,当我通过查询将数据添加到数据库 是一个问题。有些角色不工作。例如这个词:Eén。当我在PhpMyadmin添加这个词时,它是正确的。UTF-8问题
当我尝试变成Codeigniter查询时,它没有。 我的数据库站在Utf-8上。 Codeigniter配置是utf-8。数据库配置位于utf-8上。
下面是该查询:
$query = "INSERT INTO lds_leerdoel(id,leerdoel,kind_omschrijving,cito,groep_id,OCW,opbouw,
kerngebied_id,jaar_maand,KVH,craats,refnivo,toelichting,auteur)
VALUES
(
'".$this->db->escape_str($id)."',
'".$leerdoel."',
'".$this->db->escape_str($kind_omschrijving)."',
'".$this->db->escape_str($cito)."',
'".$this->db->escape_str($groep_id)."',
'".$this->db->escape_str($OCW)."',
'".$this->db->escape_str($opbouw)."',
'".$this->db->escape_str($kerngebied_id)."',
'".$this->db->escape_str($jaar_maand)."',
'".$this->db->escape_str($KVH)."',
'".$this->db->escape_str($craats)."',
'".$this->db->escape_str($refnivo)."',
'".$this->db->escape_str($toelichting)."',
'".$this->db->escape_str($auteur)."'
)";
$this->db->query($query);
的问题是场leerdoel。有人提供解决方案吗?非常感谢!!
问候, 耶勒
为什么我们在'leerdoel'上使用'utf8_decode',如果你想这是UTF-8? – Andris
嗨,那就对了。对不起,我忘了删除那个。但问题依然存在。谢谢你的评论! – JelleP