gpt4 book ai didi

html - 如何解决html中的字符编码问题?

转载 作者:可可西里 更新时间:2023-11-01 13:01:07 25 4
gpt4 key购买 nike

我有一个网页,如果我用windows记事本打开它,一段文字是这样的

Avertissement sur la sécurité

但如果我用 Notepad++ 打开它,它看起来像

enter image description here

Notepad++ 还说该文件也是 utf-8 编码。

如果我在浏览器中打开它,它看起来像

enter image description here

我有

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">也在上面。

有谁知道我该如何解决这个问题?

谢谢

最佳答案

您必须确保 <meta> 上的编码与文件编码相同(在 Notepad++ 上)。

您想使用 UTF-8 吗?

  • 在 Notepad++ 上选择 Encoding -> UTF-8 (without BOM)并保存文件。
  • 使用<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

您想使用 ISO-8859-15 吗?

  • 在 Notepad++ 上选择 Encoding -> ISO-8859-15并保存文件。
  • 使用<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">

关于html - 如何解决html中的字符编码问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39128789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com