Fork me on GitHub

article

Safari, View Source and Character Encodings

October 5, 2006 | Web Design & Development

I just hit an interesting snafu with Apple’s Safari browser. While correctly rendering special characters from a page that lacked a doctype and character encoding meta tag, I viewed the page’s source and noticed that Safari wasn’t rendering any special characters that it was rendering in the actual page view.

With the help of the W3C validator I was able to figure out what character encoding the page was in fact using, windows-1252. That’s not really any obscure. So I wonder why Safari was able to correctly decipher the page in HTML view but couldn’t apply the same logic the the source view.

Update and Addition

I’ve created a couple of pages to help illustrate my point. A valid page and an invalid page. For reference here is a valid utf-8 page for comparison. It seems that Safari has issues showing windows-1252 characters in source view in general.

So I guess its rather unfortunate that wether given the correct character encoding or not that Safari won’t show windows-1252 special characters at all in source view.

4 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  • I’m not sure what you mean by this, but I checked out a website with a different encoding other than utf-8 and the English one. (Western-2302, or whatever.) I hit source view, and it seems to render the words just fine. Or am I reading this wrong?

    Tom, October 11, 2006 10:49 am | permalink

  • I’ve added some sample pages to the story above.

    Shawn Parker, October 11, 2006 11:21 am | permalink

  • Gotcha.

    I wonder if there are any plugins to fix this.

    Tom, October 11, 2006 9:43 pm | permalink

  • I have no idea… to my knowledge there aren’t a whole lot of plug-ins for Safari. All I know of are at Pimp My Safari.

    Wow, I guess I haven’t been there in a while… there weren’t that many when I last checked. I’m gonna have to go check out what is new.

    Shawn Parker, October 14, 2006 1:19 pm | permalink

Comments are closed