From 248d0b863cde44881574ef01b974afeb2cad12e9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 1 Dec 2013 20:31:48 +0000 Subject: [PATCH 1/1] 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 --- app/assets/javascripts/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 1f9e6c891..1cbd97f86 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -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') -- 2.39.5