Mobile app version of vmapp.org
Login or Join
Tiffany637

: Default encoding vs. content-type specified encoding We have a website (www.semanticdesigns.com) that delivers a default encoding of ISO-8859-1. The pages are written in, guess what, ASCII mostly

@Tiffany637

Posted in: #ContentEncoding #Html

We have a website (www.semanticdesigns.com) that delivers a default encoding of ISO-8859-1. The pages are written in, guess what, ASCII mostly with some ISO-8859-1 characters.

We have a few example directories where the pages under that directory are actually UTF-8-encoded with BOM.
(http://www.semanticdesigns.com/Products/Formatters/JavaHTMLJunit/index.html)
These display fine in IE8 and IE9, but FireFox gets confused and displays just the BOM characters

" "


My reading of the HTML standard is that we need to add a meta tag to those pages:

<meta http-equiv="content-type" content="text/html;charset=UTF-8"></meta>


These pages are generated automatically if it isn't obvious, so this is an easy change to make. But, I tried patching this by hand, but it doesn't seem to have an effect on FireFox.

How does the browser actually decide which encoding to use? The default one provided by the server? Or what's in the meta tag? Suggestions on how to solve this problem, without changing the site default?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gretchen104

The charset specified by web server in the HTTP header has priority.

There are a few solutions to your problems:


Tell web server to output different header for files in some directories (use AddCharset of AddDefaultCharset directives in the context)
Convert all into UTF-8 and use only this charset
Convert your UTF-8 encoded pages into iso-8859-1 using HTML entities (I don't know if there is a parameter in JavaDoc allow you to do it)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme