Hi Bruce,

 

Thanks for the feed-back! I went further and made the CharacterSet class 
smarter: it now maps “MacRoman” to the preferred IANA’s name (“macintosh”). I 
would be nice if you could test again with the next snapshot or the upcoming 
2.0 M4 to confirm it fixes your issue.

 

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

 

 

 

De : Bruce Cooper [mailto:br...@brucecooper.net] 
Envoyé : samedi 11 juillet 2009 05:36
À : discuss@restlet.tigris.org
Objet : Re: Issues loading css files (from a Directory) using Firefox

 

Hi Jerome,

 

I tried the suggestion of changing the default charset in the application, and 
that has resolved the issue for me. Its probably still worthwhile registering 
this as an issue on Mac, even though there is a workaround. I'll leave it as a 
TODO in my application, just in case nobody else gets around to looking at it.

 

Thanks very much for your help,

 

Bruce.
--
www.brucecooper.net - 0417 986 274 - www.unico.com.au



2009/7/5 Jerome Louvel <jerome.lou...@noelios.com>

Hi Bruce,

Thats rather unexpected indeed. Ive checked the text/css media type and it does 
support the charset parameter:

http://tools.ietf.org/html/rfc2318

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:

http://en.wikipedia.org/wiki/Mac_OS_Roman

http://www.iana.org/assignments/character-sets 

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:

myApp.getMetadataService().setDefaultCharacterSet(CharacterSet.UTF_8);

BTW, Ive 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/> 
http://www.restlet.org
Noelios Technologies ~ Co-founder~  <http://www.noelios.com/> 
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.

Bruce.

--
www.brucecooper.net - 0417 986 274

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2372705

Reply via email to