I created an utf8 encoded RSS feed that represents news feeds retrieved from the database. I installed all aspects of my database in utf8, and also saved the text that I put into the database as utf8, pasted it into notepad and saved as utf8. This way everything should be encoded in utf8 when the RSS feed is presented to the browser, however I still get strange question mark characters for the pound signs :(
Here is my RSS feed code (CFML):
<cfsilent> <!--- Get News ---> <cfinvoke component="com.news" method="getAll" dsn="#Request.App.dsn#" returnvariable="news" /> </cfsilent> <!--- If we have news items ---> cfif news.RecordCount GT 0> <!--- Serve RSS content-type ---> <cfcontent type="application/rss+xml"> <!--- Output feed ---> <cfcontent reset="true"><?xml version="1.0" encoding="utf-8"?> <cfoutput> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>News RSS Feed</title> <link>#Application.siteRoot#</link> <description>Welcome to the News RSS Feed</description> <lastBuildDate>Wed, 19 Nov 2008 09:05:00 GMT</lastBuildDate> <language>en-uk</language> <atom:link href="#Application.siteRoot#news/rss/index.cfm" rel="self" type="application/rss+xml" /> <cfloop query="news"> <!--- Make data xml compliant ---> <cfscript> news.headline = replace(news.headline, "<", "<", "ALL"); news.body = replace(news.body, "<", "<", "ALL"); news.date = dateformat(news.date, "ddd, dd mmm yyyy"); news.time = timeformat(news.time, "HH:mm:ss") & " GMT"; </cfscript> <item> <title>#news.headline#</title> <link>#Application.siteRoot#news/index.cfm?id=#news.id#</link> <guid>#Application.siteRoot#news/index.cfm?id=#news.id#</guid> <pubDate>#news.date# #news.time#</pubDate> <description>#news.body#</description> </item> </cfloop> </channel> </rss> </cfoutput> <cfelse> <!--- If we have no news items, relocate to news page ---> <cflocation url="../news/index.cfm" addtoken="no"> </cfif>
Does anyone have any suggestions? I have done a lot of research, but I can not find the answers :(
Thanks in advance,
Chromis
source share