Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon 偶现乱码解决方案 #3196

Closed
ClarkXia opened this issue May 12, 2020 · 2 comments
Closed

icon 偶现乱码解决方案 #3196

ClarkXia opened this issue May 12, 2020 · 2 comments
Assignees

Comments

@ClarkXia
Copy link
Collaborator

ClarkXia commented May 12, 2020

现象

页面加载后,部分 icon 显示为乱码,查看 icon 对应的 css 样式,内容显示同样为乱码,
image

问题原因

css 在加载时如果编码错误,比如编码为 windows-1252,便会导致 content 内容的乱码

解决方案

方案 一

确保 css 资源以 utf-8 编码加载,(确保 <meta chartset="utf-8"/> 设置,指定 link 上的 chartset="utf-8")

 大部分情况下确保编码正确,乱码问题应该不会再出现

方案二

配合 build-plugin-fusion-unicode,将 content 内容进行转码

{
  "plugins": [
    ...
    ["build-plugin-fusion", { ... }],
    "build-plugin-fusion-unicode"
  ]
}

其他

出现 icon 乱码问题时,也可以简单对 css 的网络情况进行查看分析,在 issue 下提供相关的 case

@ClarkXia ClarkXia self-assigned this May 12, 2020
@chenbin92 chenbin92 reopened this Aug 18, 2020
@chenbin92
Copy link
Collaborator

chenbin92 commented Aug 18, 2020

该问题较为频繁,综合考考将该插件进行内置

@chenbin92 chenbin92 self-assigned this Aug 18, 2020
@chenbin92
Copy link
Collaborator

已内置在 build-plugin-fusion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants