Mangled smiley in @font-face

by Stephanie Rewis on January 5, 2011

Recently, I noticed that sometimes, when uploading a stylesheet using @font-face, my cute little smiley (thank you Paul Irish!) gets turned into some kind of garbledygook instead of the smile character. Last week, I decided to try an experiment. It cleared it right up.

To the top of your stylesheet, add this: @charset “UTF-8″;

Be sure you don’t have anything at all before it or you’ll get errors. Now your smileys will stay nice and cute. :)

{ 1 comment… read it below or add one }

Paul Irish January 6, 2011 at 3:36 am

Nice! Btw the apache config that ships with the HTML5 Boilerplate ensures a utf-8 serving of your CSS so you won’t need to be that explicit inline.

And FWIW, the ugly garbledygook is just fine too. it does the same job. But I agree.. the smiley is way better. :)

Leave a Comment