utf-8, htmlentities and htmlspecialchars in RSS feeds

Writing an RSS feed based on HTML can cause some trouble using htmlentities though it converts too much, use htmlspecialchars instead.

First: The utf8_function function converts from ISO 8859-1 to UTF-8. So you only need this function, if your input encoding/charset is ISO 8859-1. But why don’t you use UTF-8 in the first place?

Second: You don’t need htmlentities. You just need htmlspecialchars to replace the special characters by character references. htmlentities would replace “too much

Knowledge keywords: