Home  >  Article  >  Backend Development  >  php 转编码解决思路

php 转编码解决思路

WBOY
WBOYOriginal
2016-06-13 10:24:11838browse

php 转编码
从oracle导数据到mysql,oracle中的数据部分,插入时 显示Incorrect string value: '\xE6\xBB\x9A\xE5\x8A\xA8...' for column 'intro' at row 1。
比较有效的编码转换怎么实现呢,这种iconv ,mb_convert...都要字符参数。mb_detect_encoding检测也不准确,这个有什么办法呢?

------解决方案--------------------
intro 是什么类型? 我看iconv就很好用了。
------解决方案--------------------
你的数据是 utf-8 的
你的 oracle 是什么编码的?
------解决方案--------------------
但 \xE6\xBB\x9A\xE5\x8A\xA8 是utf-8编码的 滚动 两字

连接 oracle 是你设置了字符集吗?
------解决方案--------------------
你两个数据库的编码都是utf-8,那就不需要读取后再进行编码转换了
1、操作页面是否是utf-8?
2、访问oracle数据库,连接字符集要设置成UTF-8
3、操作MYSQL数据库,同样。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn