Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通过 fs.readFile 获取文件,输出显示以下字符:
á(以及任何带重音的字母)、¿ 等。
作为问号“?”。
我想这是一个编码问题,因为我使用的是 UTF8,我该如何解决这个问题?
如果您在 HTML 中显示您的内容
放<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />