Support » Fixing WordPress » Charset Problems in RSS feed

  • I’ve got WP 2.0 and it’s set to run feeds as UTF-8. My website is also set to UTF-8. Yet, whenever my website pulls the WP feed from the wp-rss2.php feed URL, the following characters have issues:

    apostrophe/single quote (‘)
    double quote (“)

    Each of these shows up as a question mark (?) on my site. You can see an example on my test page: — look under the Latest Blog section… the ? in the title should be a single quote ‘

Viewing 4 replies - 1 through 4 (of 4 total)
  • One more bit of info… the character problem only happens in the title, not in the body, of the post… and it only happens on the website (not the actual blog). It’s strange that way.

    This is not an issue with the character set. Rather it’s a combination of problems: the RSS2 format and the ability of aggregation tools to read “advanced” HTML character entities (i.e. “ for “ and ” for ”), and WordPress’ desire to convert nearly everything (which is usually a good thing, just not in this case).

    There are a few ways you can fix this:

    1. Edit your wp-rss2.php file. Just change the <title> element for the post title from this:

    <title><?php the_title_rss() ?></title>

    to this:

    <title><![CDATA[<?php the_title_rss() ?>]]></title>

    2. In template-functions-post.php (wp-includes/ directory) locate the_title_rss() function, and specifically this line in it:

    $title = apply_filters('the_title', $title);

    Just comment it out:

    // $title = apply_filters('the_title', $title);

    For both, be aware of the source hacker’s warnings: back up any files before editing them, and comment your changes for future reference.

    Thank you, Kafkaesqui! Your help resolved the problem. May you be blessed in all you do.

    Has this been “fixed” in 2.04? The file template-functions-post.php no longer has the statement:

    $title = apply_filters(‘the_title’, $title);

    Now, it has the statement as part of a function as follows:

    function the_title($before = ”, $after = ”, $echo = true) {
    $title = get_the_title();
    if ( strlen($title) > 0 ) {
    $title = apply_filters(‘the_title’, $before . $title . $after, $before, $after);
    if ( $echo )
    echo $title;
    return $title;

    I went ahead and made the change to the wp-rss2.php file since I was still noticing problems with the apostrophe, double dash, and quotation marks. I’ll see if the single change clears it up. If not, I’ll experiment with commenting out the apply filters statement.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Charset Problems in RSS feed’ is closed to new replies.