Saturday, April 24, 2010

Facebook loves  

Just recently, Facebook has messed up all instances of a unicode character "à" (latin small letter A with grave, code: U+00E0). My biggest guess is they (Facebook Team) ran into a UI problem so they decide to make dirty str_replace before sending output for both the main site and mobile site. I said it's just some kind of search and replace for the output because getting posts directly with Facebook API works just fine


The replacement originally is "&nbsp;" but for some reasons, it gets displayed as "?nbsp;". FYI, &nbsp; is a html entity which means "no break space". What the hell is it? Normally, all browser will ignore multiple spaces placed together. This is used as a trick to bypass character count in replying post: just type an emoticon (":D", 2 characters), hold the space bar for a few seconds to generate around 20 spaces, type anything else (a period is enough). The post will be displayed with only 1 space between the emoticon and the period. Note that if you don't type the period, it's high chance that the post will be trimed (remove spaces at the beginning and the end) so your post will failed the character count validation. Back to &nbsp;, using it just like space but browser will keep them as it. You put 20 of them, they will be displayed all. Some people even used &nbsp; to indent their stuffs! Actually, it's sometime useful to use &nbsp;, for example when you have to leave an empty <div>
or <td>, you should place a &nbsp; inside to make the XHTML document validated. See the demonstration below: they both have 20 spaces between the emoticon and the period.

  • Using spaces: ":D ."
  • Using &nbsp;: ":D                    ."

Anyway, a bug has been filed but I think Vietnamese users will have to wait. Stay calm, everybody.