[Tutor] browser encoding standards?

Serdar Tumgoren zstumgoren at gmail.com
Mon Jul 13 21:49:57 CEST 2009


Hi everyone,

I just ran into a glitch that got me wondering about the proper
encoding to use when outputting data for non-technical folks.

I took pains to ensure that I converted a number of XML feeds to UTF-8
prior to storage in a database. And then, when pulling the feed data
from a database to generate an HTML file, I once again was careful to
write the data to the HTML file using UTF-8.

The problem I stumbled into is that when I used UTF-8, several
characters showed up as gobbledygook in my Firefox browser.
Specifically, the characters "\u201c" and "\u201d" (quote marks) were
not carrying over. Some googling revealed that I should change my
browser's default character set. I switched form Western ISO to UTF-8,
and sure enough, the quote marks appeared correctly.

My concern now is that this "solution" is far from obvious. The data
is intended to be emailed as an HTML attachment to numerous
non-technical folks in my office in America, and they likely have no
idea about browser encodings and the ability to change them.

So the question --  given my target audience, is there a particular
encoding (such as Windows-1252) that would guarantee the file would
render properly in the most browsers? Or is it better to always use
UTF-8 and let people figure things out for themselves? With the
latter, I worry that the file will appear like sloppy work when in
fact it's a just a browser setting issue....

Advice is greatly appreciated!

Serdar


More information about the Tutor mailing list