Thread tagged as: Problem, Runway, Blog

RSS encoding and whitespace

Hello, trying to create an RSS feed for a blog, I'm using the default rss.php and rss_post.html. The only change I've made is pulling some block contents like this

        <perch:blog id="postTitle" />
        <perch:blog id="domain" /><perch:blog id="postURL" />
        <perch:blog id="domain" /><perch:blog id="postURL" />
    <description><perch:if exists="postDescHTML"><![CDATA[<perch:blog id="postDescHTML" encode="false" />]]><perch:else /><![CDATA[<perch:blocks><perch:block type="text" label="Texto"><div class="simpletext__base simpletext--editor">
    <perch:content id="simple-text" type="textarea" label="Texto Simple" html="false" escape="true" />
</div></perch:block><perch:block type="image" label="Imagen"><perch:template path="blog/body_image.html" /></perch:block><perch:block type="list" label="listado"><perch:template path="content/list.html" rescope="parent" /></perch:block></perch:blocks>]]></perch:if>
        <perch:blog id="postDateTime" format="D, d M Y H:i:s O" />

The main problem is that special characters appear with wrong encoding. For example continuación and También instead of continuación and También. Adding encoding="utf-8" on the top of the feed makes no difference. I'm completely confused with Windows-1252, ISO 8859-1 and so on.

The second and minor issue is that there are some huge white spaces between html tags in the description output.

Could you please help?

Proko Mountrichas

Proko Mountrichas 3 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What encoding is your server sending in the http headers?

I don't see anything related to encoding in the Response Headers. Does this help?


Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't have permission to view that image.

Updated, sorry!

Drew McLellan

Drew McLellan 2638 points
Perch Support


 header('Content-Type: application/rss+xml; charset=utf-8');

Great! Encoding is ok now.

Do you think white spaces could be equally easy to address?

Edit: No worries I will do a post processing/formatting.