反应字符集无法正确显示UTF-8 [英] React charset not display correctly UTF-8
本文介绍了反应字符集无法正确显示UTF-8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Materiul-UI工具包进行反应,构建后,UTF-8 字符集无法正确显示.
I use to Materiul-UI kit for react, After build, UTF-8 character set does not correctly display.
代替UTF-8字符集.'Ş,Ü,ö,Ç,ç',显示该问题符号.'?'
Instead of UTF-8 character set exc. 'Ş,Ü,ö,Ç,ç', Shows that question symbol. '?'
我在单页html上尝试使用此方法.
I try this on my single page html.
<meta charset="utf-8">
但不起作用.吉里斯->吉里?
but doesn't work. Giriş --> Giri?
推荐答案
好吧,如果您将带有字符集的meta标签添加到html < head>
中,则可能存在问题:>
Well, if you have added the meta tag with charset to html <head>
there might be a problem with:
- 您的代码编辑器或IDE未使用UTF-8字符集(请检查您的设置).
- 您在应用中使用的自定义字体没有这些字符.(也许您只是添加
font-family:"yourFont";
但有字符时应使用其他字体系列在您的自定义字体系列font-family中不存在:"yourFont",无衬线;
) - 如果您使用上面提到的带重音或特殊字符的代码在不同的编码设置f中编写代码,例如您的代码编辑器/IDE中的
ISO-8859-15
并使用webpack,您可以从此处尝试使用插件反应+ Webpack字符编码问题.
- Your code editor or IDE is not using UTF-8 charset (check your settings).
- You're using a custom font in your app that hasn't these characters. (maybe you're only add
font-family: "yourFont";
but you should use a alternative font family when you have a character that doesn't exists in your custom font familyfont-family: "yourFont", sans-serif;
) - If you're writing your code using accented or special chars like you mentioned above in different encoding setting f.e.
ISO-8859-15
in your code editor/IDE and using webpack, you can try a plugin from here React + Webpack character enconding issues.
这篇关于反应字符集无法正确显示UTF-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文