我创建了一个utf8编码的RSS源,它提供从数据库中提取的新闻数据.我已经将我的数据库的所有方面都设置为utf8,并通过将其粘贴到记事本并保存为utf8来保存我作为utf8放入数据库的文本.因此,当RSS源呈现给浏览器时,所有内容都应该以utf8编码,但是我仍然得到英镑符号的奇怪问号字符:(
这是我的RSS提要代码(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, "<", …
Run Code Online (Sandbox Code Playgroud)