Converting From Named to Numbered Entities

I’ve been having some feed issues lately, thanks to my propensity for using proper(ish) typography, such as real quotes (“=“,”=”,‘=‘’=’) in my content and headlines. The problem was that XML doesn’t behave very well with some of the named HTML entities. My feed-generation code had some conversion set up using html_decode_entities() and a declared charset of UTF-8 for the document and decoded entities, which can handle them all, but for whatever reason no luck; It was still generating invalid RSS feeds. Matt Robinson’s code for conversion to numbered entities fixed it all up nice and clean-like. Thanks, man.

This entry was posted in Front-end Dev and tagged , . Bookmark the permalink.
Like what you read? Share:
or Subscribe:

Similar Posts

  • No comments yet. Be the first!
  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>