简体   繁体   English

一些字符有问题

[英]Problems with some characters

I was having problems with this character: ' 我对此字符有疑问: '

It displays as some rhombus like gibberish. 它显示为一些菱形,像胡言乱语。

To fix this, I added $content =mb_convert_encoding($content,'UTF-8'); 为了解决这个问题,我添加了$content =mb_convert_encoding($content,'UTF-8'); before displaying. 在显示之前。

Now it doesn't display the gibberish and the character ' either. 现在,它也不会显示乱码和字符'

How do I fix this? 我该如何解决?

  1. Make sure to set the page charset to UTF-8 in the header 确保在页眉中将页面字符集设置为UTF-8
  2. If you write these signs in the document itself, make sure to save it as UTF-8 如果您将这些符号写在文档本身中,请确保将其另存为UTF-8
  3. If you store them in a database, make sure to have the table charset set to UTF-8 and write to and read from the database with the same charset. 如果将它们存储在数据库中,请确保将表字符集设置为UTF-8,并使用相同的字符集对数据库进行读写操作。

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

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