Hi Bruce,


That’s rather unexpected indeed. I’ve checked the text/css media type and it
does support the charset parameter:



What seems wrong is the name of the character set. Looking at IANA registry,
the proper name is either “macintosh” or “mac”, but not “MACROMAN”:




A test that would be interesting to do is to change the default character
set to something like UTF-8 to see if this is the value of the character set
that annoys FireFox. One way to do this is:




BTW, I’ve also added CharacterSet.MACINTOSH constant and default extension
mappings for character sets in MetadataService (“ascii”, “utf8”, “utf16”,
“mac”, “win”).


Best regards,
Jerome Louvel
Restlet ~ Founder and Lead developer ~  <http://www.restlet.org/>
Noelios Technologies ~ Co-founder ~  <http://www.noelios.com/>




De : Bruce Cooper [mailto:br...@brucecooper.net] 
Envoyé : dimanche 28 juin 2009 10:38
À : discuss@restlet.tigris.org
Objet : Issues loading css files (from a Directory) using Firefox


Hi guys,


I've been using a Directory object to serve up the user interface of my REST
style application, and that application consists of HTML, javascript and
CSS.  I've found today that Firefox 3.5 on my Mac was not reading CSS files
correctly.  To be more specific, it was reading the files, but was not using
the results that were returned.  


To work out what was going wrong, I wrote a simple test page, which had a
single DIV with a background color set by a style in an attached style
sheet.  Viewing the page directly from the disk using Safari or Firefox
worked.  Viewing the Page when served by Apache worked for both Safari and
Firefox.  When the files were served up by the restlet engine, it continued
to work correctly in Safari, but Firefox ignored the stylesheet.  After
this, I spent a bit of time in Firebug having a look in headers. The main
difference I could see was that the restlet engine was reporting the
content-type of the repsonse as


text/css; charset=MACROMAN


Whereas Apache was just returning the content type as text/css.


I've dug around the code and found that in org.restlet.engine.local.Entity
line 252 it sets the charset of the response to the platform default if it
hasn't already been set.  To test my theory, I commented out this part of
the code, and Firefox started responding correctly to the CSS file again (as
shown in Picture 10).


I don't know if it is Firefox not understanding the charset or whether it
just doesn't like the charset at all, but either way it is a problem.  For
the moment, I'll just be leaving this code commented out, but I would
appreciate some advice on the best way to fix this.


Please let me know if you need any more information.



www.brucecooper.net - 0417 986 274


Reply via email to