React charset not display correctly UTF-8

杀马特。学长 韩版系。学妹 提交于 2021-02-04 21:44:52

问题


I use to Materiul-UI kit for react, After build, UTF-8 character set does not correctly display.

Instead of UTF-8 character set exc. 'Ş,Ü,ö,Ç,ç', Shows that question symbol. '?'

I try this on my single page html.

<meta charset="utf-8">

but doesn't work. Giriş --> Giri?


回答1:


Well, if you have added the meta tag with charset to html <head> there might be a problem with:

  1. Your code editor or IDE is not using UTF-8 charset (check your settings).
  2. 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 family font-family: "yourFont", sans-serif;)
  3. 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.


来源:https://stackoverflow.com/questions/58486833/react-charset-not-display-correctly-utf-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!