Quantcast
Channel: php rss feed character encoding multilingual feed items - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Esailija for php rss feed character encoding multilingual feed items

$
0
0

It's supposed to be: header('Content-Type: application/rss+xml; charset=UTF-8');, you are missing a semicolon. Your data is already UTF-8 which is evidenced by htmlentities working out θ when UTF-8 is specified. Since your data is already in UTF-8, utf8_encode will make it even worse.

There is no need for any conversion, you should check if the proper header changes anything. Your raw output is correct, it's just that it's being interpreted as Windows-1252 instead of UTF-8.


Btw, in XML μ and θare undefined entities by default. This shows an example how to define entities, but is not really valid:
<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE channel[<!ENTITY mu   "&#924;"><!ENTITY theta   "&#920;">]><channel>EVERSOR - O &mu;Ã\x8fÂ\x8d&theta;</channel>

Nevertheless, it gets shown correctly in chrome and firefox, without undefined entity erros.

This is just supplemental information, your raw data is correct in the first place so nothing need to be done.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>