The idiocy of the internet

I had a problem earlier today: I had a Javascript source file with string literals encoded in UTF-8. Firefox and Safari were interpreting the source code as ISO-8859, screwing up the accented characters. I was retrieving these files from the local filesystem. I got a bit lazy and go on Freenode's ##javascript channel and asked my question:

edw: How does one tell a browser what encoding a Javascript source file uses? I have UTF-8 string literals in a source file that are being (I think) being interpreted as iso-8859.

moron-a: javascript uses utf16, utf8 should not be a problem

edw: Right, but Safari and Firefox are interpreting the source file as iso-8859 aka latin-1.

moron-b: Are you serving JS as utf-8 from the server? Is the page utf-8?

edw: This is (currently) a static page out of the local filesystem.

moron-c: edw: content-type.

edw: moron-c: In the SCRIPT element?

moron-c: edw: it's something the server sends to the client.. it's a http-header.

edw: moron-c: Right, but I'm loading these files locally for the moment.

moron-b: There's your problem

moron-c: edw: in that case you just have to save the content of the files as utf-8.

moron-c: edw: try with a BOM, may help...

edw: moron-c: The file is saved as UTF-8. Getting a browser to intepret it as such is another matter.

moron-d: edw: beyond <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ?

edw:The answer to the question, for future reference, is to add a CHARSET attribute of the SCRIPT element. moron-d: Firefox and Safari do not infer the encoding of a referenced resource from the encoding of the referencing resource.

I finally found the solution I mentioned above by looking at a standards document on the WHATNG site. I don't mind not being able to get an answer on IRC so much as I mind the eagerness with which the completely clueless blast non sequiturs and incorrect answers at those asking questions. I can't remember that last time I got an intelligent answer, free of personal insult, from an IRC channel. (Actually, I can: The main developer of CouchDB gave me some very good advice a couple of months ago. Thank you!)