MySQL - 俄语字符显示不正确
我必须制作一个网站的俄语版本,但我不知道如何将俄语字符插入数据库。
我尝试了几乎所有可能的编码,但它只显示:
???????? ?????????? ??????? ??????? ? ????? ?? ????????????? ? ???????, ??????? ????? ??????? ???????? ????? .??? ??????????? ???????? ????? ?? ????? ?????????? ? ????? ????????.
??????????? ?????? ?? ???????? ????? ?? 20 ???????. ???????? ??? ?? ??????????? ?????????????? ????? ? ????????????? ??????? ??????. ? ???????, ? ??????? ? ?.?.
I have to make an russian version of a website, but I can't find out, how to insert russian characters into Database.
I tryed almost every possible coding, but it only shows:
???????? ?????????? ??????? ??????? ? ????? ?? ????????????? ? ???????, ??????? ????? ??????? ???????? ????? .??? ??????????? ???????? ????? ?? ????? ?????????? ? ????? ????????.
??????????? ?????? ?? ???????? ????? ?? 20 ???????. ???????? ??? ?? ??????????? ?????????????? ????? ? ????????????? ??????? ??????. ? ???????, ? ??????? ? ?.?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
text/html 来确保编码为 UTF-8;字符集=utf-8
。直接在表单输入中输入俄语文本。SET NAMES utf8
,以便在插入数据之前将其存储为 UTF-8,事先在单独的查询中。Content-Type
为text/html;字符集=utf-8
。确保内容类型不是 windows-1251 或 iso-8859-1/latin1。确保数据库字符集/排序规则不是 ISO-8859-1/Latin1。
text/html; charset=utf-8
. Enter in russian text directly to the form input.SET NAMES utf8
so it's stored as UTF-8 before you insert the data, in a separate query beforehand.Content-Type
istext/html; charset=utf-8
.Make sure that the content-type is not windows-1251 or iso-8859-1/latin1. Make sure the database charset/collation is NOT ISO-8859-1/Latin1.
为了在数据库中存储俄语字符,您的数据库应该支持 UTF-8 编码。
使用以下查询修改您的表以启用 UTF-8 编码。
For storing russian characters in db your db should support UTF-8 encoding.
Modify your table with below query to enable UTF-8 encoding.
确保您的数据库表设置为 UTF-8 编码。您可以运行以下 SQL 查询:
确保您的数据库连接也使用 UTF-8 编码:
确保您的 HTML 表单配置为使用 UTF-8 编码:
Make sure that your database table is set to UTF-8 encoding. You can run the following SQL query:
Make sure that your database connection also uses UTF-8 encoding:
Make sure that your HTML form is configured to use UTF-8 encoding: