php错误描述:不正确的字符串值:'\ xF4t l'\ xE9 ...' [英] php Error description: Incorrect string value: '\xF4t l'\xE9...' on insert

查看:163
本文介绍了php错误描述:不正确的字符串值:'\ xF4t l'\ xE9 ...'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将数据从UTF8-general-ci表插入到另一个UTF8-general-ci表中.这些是文章.由于随机使用法语标题或短语àla",因此不会插入大约20或30.我收到的错误是错误说明:错误的字符串值:'\ xF4t l'\ xE9 ...'.

I am inserting data from a UTF8-general-ci table to another UTF8-general-ci table. These are articles. About 20 or 30 will not insert due to random use of French titles or phrases like " à la". The error I receive is Error description: Incorrect string value: '\xF4t l'\xE9...'.

我似乎什么都没做,包括添加

Nothing I do seems to work, including adding

 mysqli_set_charset($conn, "utf8");

如果两个表都已经是UTF8,我该怎么做才能插入这些带有法语短语的随机文章?

If both tables are already UTF8, what else can I do to insert these random articles with French phrases?

推荐答案

您在问题中引用的字节(F4和E9)在UTF-8数据中无效.您的部分或全部数据可能实际上是ISO-8859-1-您需要使用 iconv() .

The bytes you've quoted in your question (F4 and E9) aren't valid in UTF-8 data. Some or all of your data is probably actually ISO-8859-1 — you'll need to convert it to UTF-8 using mb_convert_encoding() or iconv().

这篇关于php错误描述:不正确的字符串值:'\ xF4t l'\ xE9 ...'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆