简体   繁体   English

数据库插入中的特殊字符格式错误

[英]Special characters misform in database insert

I am using UTF-8 in my HTML and have set my database table's collation to UTF-8 Unicode. 我在HTML中使用UTF-8,并将数据库表的排序规则设置为UTF-8 Unicode。 The data I am saving comes from an external source, but when viewing it on the website (in UTF-8) it works out fine. 我保存的数据来自外部来源,但是在网站上(以UTF-8使用)查看时,效果很好。

Now when I store the values from php using an insert query, values like 'Bearwölf' misform to 'Bearwölf'. 现在,当我使用插入查询存储来自php的值时,“Bearwölf”之类的值会变形为“Bearwölf”。

How do I get around this? 我该如何解决? I don't think there's many more details to provide, if you think of something please let me know. 我认为没有更多的细节可以提供,如果您有其他想法,请告诉我。

更改了API以提供utf 8编码的字符串,问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM