Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add meta header to HTML docs to force utf-8
When using Firefox 45.0.2 on Debian linux, I noticed that Gröbner appears correctly on http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.8.2/share/doc/Macaulay2/Macaulay2Doc/html/_gb.html but garbled on file:///usr/share/doc/Macaulay2/Macaulay2Doc/html/_gb.html Changing Firefox's "Text encoding" setting from "Western" to "Unicode" fixes the matter, so it appears to be using the wrong character encoding. All of M2's HTML documentation declares itself as XHTML and tries to declare its character encoding as utf-8 in the <?xml...> tag. This apparently works if the XHTML is parsed as XHTML. However, many XHTML documents are not parsed as XHTML; for instance, as of April 2016, the web server for M2's online documentation includes the HTTP header Content-Type: text/html; charset=utf-8 and this MIME type apparently forces many browsers to read the docs as HTML: https://www.w3.org/International/articles/serving-xhtml/index#mime For HTML, it is recommended: https://www.w3.org/International/questions/qa-html-encoding-declarations#quickanswer to always set the character encoding using a <meta...> tag or an HTTP header. Because (I think) of the above problems with XHTML being interpreted as HTML, the same is recommended for XHTML documents: https://www.w3.org/TR/xhtml1/#C_9 The problem here is that the local M2 documentation has neither an HTTP header nor a <meta...> tag to set the character encoding, and on my system Firefox is guessing wrong. This change adds the tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> inside the <head> of each HTML document, right after </title>, to force the UTF-8 character encoding everywhere.
- Loading branch information