UTF-8 和 UTF-8 ISO-8859-2 问题

发布于 2024-11-23 21:46:13 字数 198 浏览 4 评论 0原文

我遇到了 html 编码问题。我在 PSPad 上工作。我将 utf-8 设置为文件中的字符集,并将 utf-8 设置为文件格式,它在本地主机上看起来很好,但在服务器上却不然。 当我将文件格式更改为 iso 时,它可以在服务器上运行,但不能在本地主机上运行,​​并且当我关闭 PSPad 并重新打开文件时,它完全破坏了一些字符。 你有什么解决办法吗?真是太烦人了! :) 谢谢 K.

I've got a problem with html encoding. I work on PSPad. I set utf-8 as charset in my files and utf-8 as a file format and it look fine on localhost but doesn't on a server.
When i change file format to iso it works on a server but doesn't on localhost and when i close PSPad and reopen the file it totaly breaks some of the characters.
Do u have any solution? It so annoying! :)
thanks
K.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陪你搞怪i 2024-11-30 21:46:13

确保外部服务器也发送字符集声明。您使用什么服务器软件?在 Apache 中,您可以通过添加包含以下内容的 .htaccess 文件来实现:

AddCharset utf-8 .html

还要确保添加

 <meta charset="utf-8">

声明 (HTML5) 或

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

到 HTML 文件头。

编辑:更正错别字

Make sure that the foreign server sends a charset declaration as well. What server software do you use? In Apache you could achieve it by adding a .htaccess file with the following content:

AddCharset utf-8 .html

Also make sure that you add a

 <meta charset="utf-8">

declaration (HTML5) or a

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

To the HTML file header.

Edit: corrected typos

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文