News Section - Foreign Language Website Puzzle - Firefox, CSS and File Encoding
Developer Blog from Mike Irving - Foreign Language Website Puzzle - Firefox, CSS and File Encoding
25/11/2008 - Foreign Language Website Puzzle - Firefox, CSS and File EncodingI had an interesting problem to solve the other week when looking over a website page that had been translated to Russian, and was delivered from a machine hosted in Russia.
The translation was fine, so far as my Russian goes, and the page looked great in both Internet Explorer and Opera. In Firefox and Safari however, it renedered as just the text, without any of the website design or CSS.
Interestingly, if I clicked "Edit CSS" in the "Web Developer" toolbar in Firefox, the page fixed itself, only to break again once the editor window had been closed.
I tried a number of things to fix the situation...
Firstly, I made sure the web hosting package delivered the correct MIME-Type for CSS files, which should be "text/css" - it did.
Secondly, I made sure my FTP program was uploading the file in Binary Mode, not in ASCII mode, as this would not be appropriate for Russian-Type.
After the two actions above yielded no results, I turned my attention to file-encodings.
Being in Cyrillic Text, the HMTL file was saved in UTF-16 format, with Unix (LF) Line Breaks.
However, the CSS Stylesheet was cloned from an English web page, and was in ANSI format.
To cut a long story short, it seems Mozilla Firefox, and Apple Safari, get confused if you mix File-Type Encodings across portions of webpages.
To remedy, I set all to UTF-16 and Unix Line Breaks.
I did this in Microsoft Visual Studio, from the advanced options in the "Save As" dialog. Similar options can be selected in Windows Notepad, and other text editors.
View Blog Entries - Page: 1, 2, 3, 4, 5, 6
This week I have delivered a completely redesigned website for Andy Till. Andy is a Personal Friend, Professional Bass Player, and star of the new 2008 Hovis Adverts! The old site had been onlin...
• Read This Blog Entry
I seem to have been increasingly using the Lightbox Photo Viewer on websites in recent times. Lightbox is a light-weight, and cross-platform, solution for opening up full-size images within the cur...
• Read This Blog Entry
The recent launch of both Firefox 3 and Google's browser Chrome, will have caused headache's for many website developers. Different web browsers will render websites slightly differently to one ano...
• Read This Blog Entry

