Character Encoding Issue - Strange Behaviour From Pound Signs (£) with UTF-8 IE6 / ASP / XML

前端 未结 2 898
星月不相逢
星月不相逢 2020-12-17 05:17

I am having a very strange problem with pound signs displaying incorrectly (or not at all) on a web page.

I am keying text in a textbox, which then gets (briefly) st

2条回答
  •  情书的邮戳
    2020-12-17 06:20

    You say that the site doesn't always say which character encodings are being used. In that case, browsers will have to guess. And they might guess differently on different pages, which is quite likely the reason why you're seeing inconsistencies.

    A lot of character encodings are "ASCII plus" (ASCII plus extended Latin characters; ASCII plus the Greek alphabet; ASCII plus the Cyrillic alphabet; etc.). How is a browser supposed to know which is intended? One way is by looking at code-point frequency: "I'm seeing a lot of the code-point [blah], which would be character [?A] in Greek, or character [?B] in Cyrillic. Character [?A] isn't very common in Greek, but [?B] is quite frequent in Bulgarian, so this page is quite likely in the Cyrillic alphabet." That kind of thing. And that means that slightly different text on the page, shuffling around the code-point frequencies, can lead to browsers interpreting the text encoding completely differently. This is why we use UTF-8 these days. It's also why we declare the text encoding in HTTP headers and in meta tags.

提交回复
热议问题