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 Great Code, Troubleshooting. Bookmark the permalink.
Similar Posts
- Elegant Code Patterns—Set and Return a Variable in One Line
- Elegant Code Patterns—Drop the Else When Code is Repeated



