Page MenuHomePhabricator

Bad charset in cached pages.
Closed, ResolvedPublic

Description

Author: vasc

Description:
Hello,

I have these variables set in my LocalSettings.php:
$wgLanguageCode = "en";
$wgUseLatin1 = false;

$wgUseFileCache = true;
$wgUseGzip = false;

So my Wiki is in English/UTF-8.

When an anonymous user is fetching pages from the file cache, my browser
(Mozilla Firefox) detects the page charset wrong. It gets the default httpd
charset instead of UTF-8. While a logged in user, not getting his page from the
file cache, will have his browser detect the page charset correctly as UTF-8.

I tried setting:
$wgInputEncoding = "UTF-8";
$wgOutputEncoding = "UTF-8";

It didn't help. I assume the PHP code which sends pages from the file cache does
not send a proper HTTP Header with charset=UTF-8, while the regular uncached
code does.

I have temporarily worked around this via my httpd config, but its a kludge at best.


Version: 1.3.x
Severity: major
Platform: PC

Details

Reference
bz718

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 7:00 PM
bzimport set Reference to bz718.
bzimport added a subscriber: Unknown Object (MLST).

zhengzhu wrote:

fixed CacheManager.php in cvs HEAD (v1.11) and REL1_3 (v1.5.2.3)