在iOS8系统,WKwebView加载本地html,若js和css文件出现乱码(可以用safari调试,然后查看相关文件是否乱码)的解决方案如下:
<script 里追加charset = "utf-8" , <script charset = "utf-8"
<link 里追加charset = "utf-8",<link charset = "utf-8"
在获取到html文本后,使用字符串替换
<script 替换成 <script charset = "utf-8"
<link 替换成 <link charset = "utf-8"