Does anyone know why wordpress converts some html entities to their numeric equivalents?

I've found that in some posts, where a non-breaking space   entity would be appropriate, wordpress uses   instead.

Seems to me that using the symbolic version of the entity would be better than a numeric version.

The routine that this is being done in (appears to be) ent2ncr in wp-includes/formatting.php.

When I converted my blog from a single site to multi-site (different install & database), the numeric entities were not converted properly (possibly due to a database difference). Had the symbolic entities been used, I doubt this would have been a problem.

  • Ok so disregard last comment your post was edited when i was typing. That is a good question. – xLRDxREVENGEx May 20 '11 at 17:13

In XHTML entities are not part of the DTD, and user agents are not required to support them. Exceptions: &, <, >, " and '.

To keep WordPress X(HT)ML compatible numeric references are used instead.

  • That makes since. back to the old days instead i guess with that format. – xLRDxREVENGEx May 20 '11 at 17:22
  • Seems like a step backwards to me, but oh well. – David G Jun 4 '11 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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