RE: http charset, <script> and IE

>
>Hi,
>
>I have been testing IE 7 and I find that if an html page calls an external 
>javascript file, the browser doesn't seem to respect the charset setting in 
>the http protocol.
>
>If I set the charset in the script element <script charset=... src=...>
>the script is loaded and converted to the character encoding of the web 
>page.
>
>However, if instead, I set charset in the http protocol that returns the 
>.js file and do not use the charset attribute in the script element, IE7 
>doesn't perform a conversion.
>
>Firefox works as I expect.
>
>I have tried using several different mime types (text/javascript, 
>application/javascript, application/x-javascript) and even different 
>encoding names, since IE is a bit odd with Korean encoding names.
>
>However, I can't seem to get IE7 to render a utf-8 html page properly that 
>includes an euc-kr javascript file without setting the charset attribute in 
>the script element.
>
>For a number of reasons, I would prefer the web server set the encoding of 
>the script rather than have the web page know how the script was authored. 
>(Duh!)
>
>Anyone found a way to get IE respect the http charset?
>
>I did find that having the web page in the Korean encoding and including a 
>utf-8 javascript file seemed to work, but I suspect it was because notepad 
>put a bom on the file and IE used that rather than the http setting to 
>deteremine the encoding and convert it to cp949.
>
>I am hoping there is some quirk mode or non-quirk mode or new-quirk mode or 
>captain-quirk mode that makes IE behave right.
>I haven't tried IE 6 but I am guessing it has the same issue.
>
><rant on>
>The concept of declaring encodings in the retrieving page rather than the 
>retrieved page is brain-dead if you ask me and should be stricken from 
>specs.
>Authors and Pubishers should declare the encoding. (And it should be 
>unicode.)
>
That's an ideal to shoot for--most versions of notepad out today will encode 
files as utf-8; but not everyone has editors for unicode that do not put a 
bom in files and I do not think we can expect them to have these.
Also I have to tell you, some online text editors, for file creation, do not 
encode unicode characters.
That's life.  Wish they'd all upgrade.
But some people have to use those so alas not every file will be unicode, 
but I do agree, the authors and applications that create pages should 
declare the encoding.

--C. E. Whitehead
cewcathar@hotmail.com

>Consumers shouldn't have to figure out the encoding of material they 
>consume.
></rant on>
>
>tex

_________________________________________________________________
http://newlivehotmail.com

Received on Sunday, 29 July 2007 21:55:33 UTC