expando.github.com
expando.github.com copied to clipboard
Issues encoding the title
According to expando website: "Make sure to encode the link and title so that all control characters are encoded."
In order to do that, I'm using the php function rawurlencode. I'm having some troubles when characters like 'á' or 'ñ' are encoded. When the title of the publication to share has an acute accent, or a non-English letter, like 'ñ' the widget doesn't properly render: In that circumstance the icons of the social networks are not rendered, and only the final arrow is rendered.
A workaround to this problem is to replace those characters with their respective html codes before calling rawurlencode, so that rawurlencode has to encode for example á ; instead of á. With this trick the widget is properly loaded, but some sharers, like twitter, escape what they receive so that the title of the publication becomes á ; instead of á. Am I missing something, doing something wrong or the widget has issues with those characters? Note that rawurlencode properly encodes what it receives, but it seems that expando fails handling those those encoded characters.
Note that the space included between 'á' and ';' is only mean to avoid printing 'á' in this editor.
Thanking you.
Well, if $title is the var that contains what you want as title, then rawurlencode(htmlentities($title)); seems to partly work, except from the fact that you share á ; instead of á. Twitter for example handles the title literally "á ;", instead of understanding that your are submitting an "á". Is there any way to solve this issue? Maybe the expando sharer should decode it before passing it to some networks. On the contrary, Facebook do not suffer from this problem when you call htmlentities to generate the content of any label.