Opened 13 years ago

Closed 13 years ago

#696 closed defect (fixed)

Dynamical package loading in Opera depends on "Content-Type" for *.js files

Reported by: amonduul <steeleye.winzo@…> Owned by: anonymous
Priority: low Milestone:
Component: General Version: 0.2
Keywords: opera Cc:
Blocked By: Blocking:

Description

When downloading packages via XmlHttpRequest?, if server sets "Content-Type: text/javascript", Opera misinterprets recieved content (as utf-16?) and fails to load package. (Some more info on this Opera behaviour here http://blogs.acceleration.net/birdman/archive/2005/08/17/2035.aspx)

Not sure there is a workaround to put in dojo.hostenv.getText. (Except, maybe, decoding utf16 to byte sequence and then to utf8, which seems to be tedious work, and not worth it).

Workaround in case you have access to server configuration: Change content type for *.js files from "text/javascript" to "application/x-javascript".

Possible workaround in case you don't have access to server configuration: Change extenstion for all loadable scripts to some other extension (e.g. *.dj or *.txt), and change the extenstion used for package loading in dojo.hostenv.loadModule.

Change History (2)

comment:1 Changed 13 years ago by adam@…

Could you please try Opera build 8432 at http://my.opera.com/desktopteam/blog/

I'm not sure if this is what you're describing, but I had noticed that XMLHttpRequest did not use UTF-8 by default, as it should according to the W3C draft and to mimic Moz/IE. The Opera folks graciously fixed the bug within days of me pointing this out... Does it solve your problem?

Assuming your file is encoded in utf-8 and your server does not specify any special encodings, everything ought to work. I have not tested Opera in the case where encodings are specified and are something other than utf-8.

Regards, Adam

comment:2 Changed 13 years ago by dylan

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.