CC: | "Peter Valdemar Mørch" <pmorch [...] gmail.com> |
Subject: | Sorting of html tables broken in non-utf8 encodings |
[From Peter Valdemar Mørch <pmorch@gmail.com>]
I couldn't get the tables to sort properly. Until I discovered that if the pages are served with a
webserver configured for ISO-8859-1 character set, sorting doesn't work. This is because
the page's sorting algorithm treats '\265' as a special char and it gets encoded differently for
javascript and HTML.
The HTML contains something like "183µs" (using a HTML entity) but the javascript has
this line:
val = orig.replace(/µs/,''); /* XXX use µ ? */
encoded as UTF-8. And so sorting fails if the page isn't encoded as UTF-8.