Highlighted source code on hackage.haskell.org mangles Unicode #757

Closed
bos opened this Issue May 24, 2012 · 4 comments

4 participants

@bos
Haskell member

(Imported from Trac #767, reported by andersk on 2010-11-19)

On hackage.haskell.org, when you browse the source of a module that contains Unicode (e.g. Data.Eq.Unicode), it is sent with a Content-Type: text/html header with no charset. There is a charset in the XML declaration <?xml version="1.0" encoding="UTF-8"?>, but that is ignored by Firefox because of the non-XML Content-Type. Therefore, the wrong encoding is detected and the Unicode symbols get mangled.

Possible fixes include sending Content-Type: text/html; charset=UTF-8, or sending Content-Type: application/xhtml+xml so that the XML declaration is respected , or both (Content-Type: application/xhtml+xml; charset=utf-8), or adding equivalent <meta http-equiv="Content-Type"> tags.

@bos
Haskell member

(Imported comment by gtirloni on 2010-11-19)

Confirmed problem on Firefox 7.0.1 (Linux/x86_64).

It doesn't seem to occur on Chrome 15 and Konqueror 4.7.2.

It has something to do with the implementation of RFC3023 which says HTTP should have priority over XML encoding. Firefox and Opera seem to implement it while WebKit? (Chrome) doesn't. See more at http://lists.w3.org/Archives/Public/public-html-bugzilla/2011Jun/0303.html

@manzyuk

I'm not having this problem with Firefox 20.0 (Linux/x86_64).

@andersk

The problem is still reproducible in Firefox 28.0 on Ubuntu 14.04 amd64.

@ttuegel
Haskell member

This isn't a Cabal issue.

@ttuegel ttuegel closed this Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment