Revert "Don't tell IE it's utf8. Just send it. Otherwise it'll snuff it!"

This reverts commit 5fb7a03fb34078a75fe5932563e5a9fe44c57015.
This commit is contained in:
Marcel Klehr 2012-12-19 19:48:08 +01:00
parent 00d7ebc646
commit 3c3c1630b1
1 changed files with 3 additions and 4 deletions

View File

@ -110,8 +110,7 @@ exports.expressCreateServer = function(n, args) {
//works with /locale/en and /locale/en.json requests //works with /locale/en and /locale/en.json requests
var locale = req.params.locale.split('.')[0]; var locale = req.params.locale.split('.')[0];
if (exports.availableLangs.hasOwnProperty(locale)) { if (exports.availableLangs.hasOwnProperty(locale)) {
// Don't include utf8 encoding (see https://forum.jquery.com/topic/the-problem-with-ie8-and-encoding-error-c00ce56e) res.setHeader('Content-Type', 'application/json; charset=utf8');
res.setHeader('Content-Type', 'application/json');
res.send('{"'+locale+'":'+JSON.stringify(locales[locale])+'}'); res.send('{"'+locale+'":'+JSON.stringify(locales[locale])+'}');
} else { } else {
res.send(404, 'Language not available'); res.send(404, 'Language not available');
@ -119,7 +118,7 @@ exports.expressCreateServer = function(n, args) {
}) })
args.app.get('/locales.json', function(req, res) { args.app.get('/locales.json', function(req, res) {
res.setHeader('Content-Type', 'application/json');// don't send encoding (see above) res.setHeader('Content-Type', 'application/json; charset=utf8');
res.send(localeIndex); res.send(localeIndex);
}) })