默认使用输出使用ISO-8859-1编码输出,很讨嫌。全局的编码设置对其也无效,需要修改 include/feedcreator.class.php。
方法1改2个地方:
1:生成的xml描述
"<?xml version="1.0" encoding="".$this->encoding.""?> ";
直接修改成你想要的编码
"<?xml version="1.0" encoding="gb2312"?> ";
2:输出到浏览器中的编码类型,这个相当重要,他写死了的
mime编码输出var $encoding = "ISO-8859-1"; 修改为你想要的var $encoding = "gb2312";
done!
一般都用gb2312 或者 gbk ,如果为了更好国际化就用utf-8, 呵呵
方法2
在\includes\feedcreator.class.php中,将UniversalFeedCreator类的_setFormat()函数最后几行的
if (!in_array($key, array("_feed", "contentType", "encoding"))) {
改为
if (!in_array($key, array("_feed", "contentType"))) {
即可(即去掉encoding的过滤,允许外部指定RSS的编码字符集)。
没有评论:
发表评论