HTML ISO-8859-2编码

发布于 2025-02-10 22:28:55 字数 1076 浏览 1 评论 0原文

我必须通过ISO-8859-2编码来发送一些值。

当接收器收到并显示消息时,它类似于

ä…,ä‡,ä™,ĺ,ĺ ĺƒ,“”,ĺS,ĺĺ

(堆叠溢出无法通过粘贴显示所有内容)。

提交表格的HTML页面的示例:

<html>
<SCRIPT LANGUAGE="Javascript">
  function OnLoadEvent() {
    document.downloadForm.submit();
  }
</SCRIPT>

<head>
  <meta charset="ISO-8859-2">
</head>

<body OnLoad="OnLoadEvent();">
  <form name="downloadForm" accept-charset="ISO-8859-2" action="https://url" method="POST">
    <INPUT type="hidden" name="Description" value="ŃÓô">
  </form>
</body>

</html>

我还编写简单的页面以显示一些字符。 页:

<!DOCTYPE HTML>
<HTML>

<HEAD>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-2">
</HEAD>

<BODY>
  Ńóô
</BODY>

</HTML>

但这也显示了类似的东西: ĺƒăad´ 你知道那是什么原因吗?如果我认为良好的话,此字符集应处理所有拉丁字符。

I have to send some values via post ISO-8859-2 encoded.

When the receiver got and displayed the message it was something like

Ä…,ć,Ä™,Ĺ‚,Ĺ„,Ăł,Ĺ›,Ĺş,Ĺź,Ä„,Ć,Ę,Ĺ,Ĺƒ,Ă“,Ĺš,Ĺš,Ĺť

(stack overflow cannot display all of them by paste).

The example of html page that submit form:

<html>
<SCRIPT LANGUAGE="Javascript">
  function OnLoadEvent() {
    document.downloadForm.submit();
  }
</SCRIPT>

<head>
  <meta charset="ISO-8859-2">
</head>

<body OnLoad="OnLoadEvent();">
  <form name="downloadForm" accept-charset="ISO-8859-2" action="https://url" method="POST">
    <INPUT type="hidden" name="Description" value="ŃÓô">
  </form>
</body>

</html>

I have also write simple page to display some of the characters.
Page:

<!DOCTYPE HTML>
<HTML>

<HEAD>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-2">
</HEAD>

<BODY>
  Ńóô
</BODY>

</HTML>

But it also displays something like that:
ĹƒĂłĂ´
Do you know what is the reason of that? If Im thinking good this charset should handle all of the latin characters.

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

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

发布评论

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

评论(1

一梦浮鱼 2025-02-17 22:28:55

这表明实际文本实际上不是ISO-8859-2编码的。您是表示,导致浏览器将字节视为ISO-8859-2,但实际上该字节已编码UTF-8。编码“可能”字节的UTF-8是C583 C3B3 C3B4。 ISO-8859-2对此字节序列的解释类似于“ĺăłă”。

实际上,在文本编辑器中将HTML文件保存为ISO-8859-2。

This indicates that the actual text is not actually ISO-8859-2 encoded. You denote that it is, causing the browser to treat the bytes as ISO-8859-2, but actually the bytes are UTF-8 encoded. The UTF-8 encoded bytes for "Ńóô" are c583 c3b3 c3b4. The ISO-8859-2 interpretation of this byte sequence is something like "Ĺóô".

Actually save the HTML file as ISO-8859-2 in your text editor.

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