changeset 20973:55543ee545ab

hgweb: override the charset attribute in the http request The default http request character set is UTF-8. If the message is not encoded in UTF-8, such as big5, it cannot be shown correctly. The 'charset' is overridden by the root document's, such that the user can select the proper encoding in the browser.
author Wei, Elson <elson.wei@gmail.com>
date Thu, 10 Apr 2014 15:12:12 +0800
parents 4e2fb0ad00a9
children ef377f2e0ab9
files mercurial/templates/static/mercurial.js
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/static/mercurial.js	Fri Apr 11 16:38:55 2014 -0400
+++ b/mercurial/templates/static/mercurial.js	Thu Apr 10 15:12:12 2014 +0800
@@ -327,6 +327,7 @@
     };
 
     xfr.open(method, url);
+    xfr.overrideMimeType("text/xhtml; charset=" + document.characterSet.toLowerCase());
     xfr.send();
     onstart();
     return xfr;