MySql 5.1.x:插入选择..编码字符串
我有 2 个具有相同 DEFAULT CHARSET=latin1 的表 如果我使用命令“Insert into () Select ()”将一些数据从一个表复制到另一个表,MySql 会对字符串进行编码。 示例:
2461/P/J- -- RESO N° RM10
变为 2461/P/J- -- RESO N° RM10
请注意从 °
到 °
的转换
如何避免这种情况? tnx 的建议。
i have 2 table with the same DEFAULT CHARSET=latin1
If i copy some data from one table to the another with the command 'Insert into () Select ()', MySql encode the strings.
Example:
2461/P/J- -- RESO N° RM10
became 2461/P/J- -- RESO N° RM10
note the conversion from °
to °
How can avoid this?
tnx in advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我尝试时,这种情况不会发生(MySQL 5.1.41)。您是直接从 MySQL 控制台执行此操作,还是通过 MySQL API(也许从 PHP)执行此操作?
例子:
That doesn't happen when I try it (MySQL 5.1.41). Are you doing this directly from the MySQL console, or are you perhaps doing it via the MySQL API - perhaps from PHP?
Example:
你能验证一下原表中的数据吗?如果您遇到字符集编码问题,您将看到垃圾字符等,而不是 HTML 实体。正如您的示例所示,MySQL 不会将 HTML/XML 实体转换为 HTML/XML 实体。
Can you verify the data in the original table? If you were having charset encoding issues, you would be seeing gargage characters and the like, not HTML entites. MySQL does not convert from/to HTML/XML entities as your example suggests.