Closed Bug 536529 Opened 16 years ago Closed 16 years ago

Properly set nsIChannel.contentCharset according to @charset attribute in <script> element

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Honza, Unassigned)

Details

(Whiteboard: [firebug-p2])

An issue related to charset was reported in Firebug. http://code.google.com/p/fbug/issues/detail?id=429 when debugging an html file written in UTF-8, which contains <script> tags who "point" to ISO-8859-1 encoded *.js files, firebug displays the contents of such *.js files as gibberrish. The problem is that if a JS file included using <scipt> element that specifies a charset, the underlying request _channel_ object (that is created to download the file) doesn't have set the nsIChannel.contentCharset property according to the value specified in the @charset attribute. Example: 1) This JS file is using "ISO-8859-1" <script type="text/javascript" src="dirrerentlyEncodedScriptFile.js" charset="ISO-8859-1"/> 2) The appropriate _channel_ that is opened, should have set the contentCharset prop to "ISO-8859-1". But it's empty -> BUG. Online test case: http://getfirebug.com/tests/issues/429/index.xhtml Related discussion http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/9ed8df75aa4b1f86?hl=en# Honza
Whiteboard: [firebug-p2]
DOM just needs to set the contentCharset before opening the channel
Component: Networking → DOM: Core & HTML
QA Contact: networking → general
So... As I later commented in the newsgroup, this is not documented on nsIChannel and doesn't work on channels in general (not even the ones Gecko ships by default). So I don't think DOM can in fact do this.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.