Force the X-Page-Title value to be treated as UTF-8

This is basically a black magic hack to get javascript to treat
a string as UTF-8 and decode it to the correct form.

http://monsur.hossa.in/2012/07/20/utf-8-in-javascript.html
This commit is contained in:
Tom Hughes 2013-12-01 20:31:48 +00:00
parent 61bb31ebdd
commit 248d0b863c

View file

@ -46,7 +46,8 @@
var content = $(xhr.responseText);
if (xhr.getResponseHeader('X-Page-Title')) {
document.title = xhr.getResponseHeader('X-Page-Title');
var title = xhr.getResponseHeader('X-Page-Title');
document.title = decodeURIComponent(escape(title));
}
$('head')