为什么所有的React应用开头都有一行meta charset="utf-8"语句?
答案:
The previous HTML standard (HTML 4) specified the ISO-8859-1 character set as the default. When HTML5 was released, the specification was updated to default to UTF-8. UTF-8 is a much more flexible character set, and can support languages from all over the world.
The React framework defaults to reading ISO-8859-1 characters. So, if we don’t tell it to use UTF-8 (which is what SAP Cloud Platform uses), React will not understand the characters and will throw several syntax errors.
The tag is now the recommended best practice in all HTML.要获取更多Jerry的原创文章,请关注公众号"汪子熙":
以上是 为什么所有的React应用开头都有一行meta charset="utf-8"语句? 的全部内容, 来源链接: utcz.com/z/383391.html