MS Office hyperlinks change code page?

我的梦境 提交于 2020-01-25 09:39:04

问题


When you paste the following URL into IE: http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx, the link on the right of the page cleanly says "Download Zoomit (77 KB)". If you paste the link into an Office document (Word, Excel, PowerPoint -- tested using Office 2003), and activate the link from the document, that same text has picked up a couple of A-circumflex symbols. This is because the source HTML contains " " entities (non-breaking space) which get translated to Unicode 00A0. In UTF-8, this is expressed as X'C2A0', and then the X'C2' gets displayed as a A-circumflex. I don't completely understand how the code pages get mixed up like this, but I'd really like to find a HTML meta http-equiv charset value that will cause my pages containing the nbsp-entity to display properly even when linked from an Office document.


回答1:


I found an answer that seems to be working. First I added an alert to display the document.charset. This displayed "utf-8" when invoked directly, and "windows-1252" when invoked from a hyperlink in a MS Office document. I therefore inserted the following meta-tag, and pages seem to display correctly even when invoked from Office documents:

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


来源:https://stackoverflow.com/questions/189640/ms-office-hyperlinks-change-code-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!