简体   繁体   English

特殊字符mysql-转换为“?”

[英]special character mysql - convert to “?”

I want to put in my MySQL this word: xxvęrspIøgx 我想在MySQL中输入这个词:xxvęrspIøgx

When I insert this word the result is: xxv?rspIøgx 当我插入这个词时,结果是:xxv?rspIøgx

What I have to do to support this character: ę ? 我必须做些什么来支持这个角色:ę?

I would be best to encode the word into UTF-8 before storing the word, then decode it from UTF-8 after you fetch it from the database. 在存储单词之前,最好将其编码为UTF-8,然后在从数据库中获取它之后,再从UTF-8对其进行解码。 This was elements of the word/data are not lost between transit and storage. 这是单词/数据元素在传输和存储之间不丢失的原因。

The source of your problem can be one of at least these two: 问题的根源至少可以是以下两个之一:

  1. Your data is not configured to UTF-8 Character Encoding, 您的数据未配置为UTF-8字符编码,
  2. The input mechanism does not support UTF-8 (eg if command line us used, the "TERMINAL" was not configured. 输入机制不支持UTF-8(例如,如果使用了我们的命令行,则未配置“ TERMINAL”。

Verify your DB configuration and make sure that the path (from your "client" interface and down till your "server" side are properly configured. 验证数据库配置,并确保正确配置了路径(从“客户端”界面向下直到“服务器”端)。

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

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