douhuan1497 2013-10-17 01:21
浏览 37
已采纳

Codeigniter卷曲引号(尽管UTF-8整理)

I'm using a simple form to write string to database, but the curly quotes (on retrieval) are being displayed as special characters.

So far I have tried changing the table collation to UTF-8 as well as using the CodeIgniter Typography class:

 1. alter table test.vocab convert to character set utf8 collate
    utf8_unicode_ci;
 2. $this->load->library('typography'); 
    $data['item'] = $this->typography->auto_typography($data['item'], FALSE);

This hasn't helped, though. Here's what the output looks like:

enter image description here

If needed I'll post more code. Please help.

  • 写回答

2条回答 默认 最新

  • dongmeng4742 2013-10-17 15:33
    关注

    Thank you everyone, but it seems like what I needed was the mb_convert_encoding() function:

    $i['item'] = mb_convert_encoding($i['item'], 'HTML-ENTITIES', 'UTF-8');
    

    Many thanks for taking out the time for commenting or answering.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题