HTML ISO-8859-2编码
我必须通过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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这表明实际文本实际上不是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.