Last modified: 2012-04-16 09:15:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30208, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28208 - Content-Type for JavaScript through ResourceLoader doesn't specify a charset
Content-Type for JavaScript through ResourceLoader doesn't specify a charset
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: High minor (vote)
: ---
Assigned To: Trevor Parscal
http://bits.wikimedia.org/fr.wikipedi...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-23 19:50 UTC by MZMcBride
Modified: 2012-04-16 09:15 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Sets character set to UTF-8 within the HTTP header's Content-Type field. (683 bytes, patch)
2011-04-01 19:18 UTC, Trevor Parscal
Details

Description MZMcBride 2011-03-23 19:50:57 UTC
When requesting a page such as <http://bits.wikimedia.org/fr.wikipedia.org/load.php?debug=true&lang=fr&modules=site&only=scripts> currently, the Content-Type is "text/javascript". It should be "text/javascript; charset=utf-8".
Comment 1 Mark A. Hershberger 2011-04-01 01:57:21 UTC
does this actually cause anyone problems?
Comment 2 Mark A. Hershberger 2011-04-01 02:03:47 UTC
Daniel Friesen helpfully pointed out that the URL itself demonstrates the problem.
Comment 3 Trevor Parscal 2011-04-01 19:18:45 UTC
Created attachment 8359 [details]
Sets character set to UTF-8 within the HTTP header's Content-Type field.

Here's a patch that will do the trick. I would have applied it, but I wanted to get some input on one concern.

Should we really be assuming that the JavaScript and CSS content is UTF-8? Should we be detecting the encoding and using that? What happens when we are combining multiple encodings into a single response? Should we convert everything to UTF-8?

I'm looking for some opinions, especially those based in experience with handling text encoding within MediaWiki.
Comment 4 Niklas Laxström 2011-04-01 19:27:53 UTC
Everything in MediaWiki is UTF-8 nowdays (including the source files). I'd say go for it.
Comment 5 Trevor Parscal 2011-04-01 20:49:15 UTC
Patched trunk in r85152.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links