Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I work in an IT department at a museum whose website is built on Drupal. I have experience with other CMSs, but I've only worked with Drupal a little bit. So far, I've been able to help them fix quite a few bugs with their site, but I can't find any information on how to resolve this particular one. On any content type, if the Title field has a special character it displays the character correctly on the site, but if it's linked to on Facebook and it pulls the title, it ends up showing the entity number instead.

An example:

Science Movie Night: The Shaman's Apprentice

becomes

Science Movie Night: The Shaman&# 039;s Apprentice (without space)

I've searched around, but I haven't found anything talking about how to combat this.

share|improve this question
Hi, and welcome to Drupal Answers. In order to answer your question, it would be helpful if you tagged it with the version of Drupal the site is running. This tag is just a single digit (e.g. 5, 6, or 7. However, this may have little to do with Drupal. It may be FaceBook that is replacing the character with its NCR (Numeric Character Reference), or that FaceBook automatically add escapes to quote NCRs. To check this, it would be helpful if you provided links to the original page, and somewhere on Facebook it is linked. – Gisle Hannemyr Jan 11 at 3:24
Another tip, when typing in HTML entities such as &#39, and want those those displayed literally. enclose the construct in backquotes (`). – Gisle Hannemyr Jan 11 at 3:53

1 Answer

I just checked with Drupal 7, and it will replace Unicode Character 'APOSTROPHE' with its NCR equivalent (') in headings. This is not a bug, but a security measure.

Apperently, when FaceBook receives this, it changes it to &#39, with the result you observe. IMHO, this is a bug in how Facebook treats incoming NCRs, and has nothing to do with Drupal. (It is not a good idea for Drupal to have plain apostrophes in headings.) You may want to report this bug to Facebook, but it will probably not be their top priority.

You may also add a feature request to the authors of the module the sites uses to interact with FaceBook, asking it to rewrite NCR apostrophes into a single byte ASCII before sending to FaceBook. They may be more symphatetic.

(Btw: This problem has already been mentioned on stackoverflow: http://stackoverflow.com/questions/11821400/apostrophes-turns-crazy-on-facebook-app - but I'm pretty sure the upvoted answer is hokum.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.