Skip to:

Corrupted Turkish characters on RSS Feed

  • Ali Erkurt


    @DJPaul Hello Paul. I’m having an RSS problem with characters. The problem is, when a new activity is published, some characters doesnt seem correctly on the feed (activity/feed) and this happens for all activities. It occurs for the Turkish characters. I’m using UTF-8 and the latest trunk of BP.

    Here’s the feed url:

    How can I fix that?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Bumping this so I remember to look at it later.


    Same problem by german Umlauts ÄÖÜß etc.
    But only by <![CDATA[<br /> <a href="" rel="nofollow"></a>

    Ali Erkurt


    OK, I fixed that by myself :)

    Paul has a lot to do I guess… Right @DJPaul? :)

    OK @minniwelt I’m sure you’re expecting to see the fix. Here’s the solution:

    In bp-activity-templatetags.php file, line 911, you’ll see that:

    $title = trim( strip_tags( html_entity_decode( utf8_encode( $content[0] ) ) ) );

    What causes the corrupted characters is “utf8_encode” thing. I’m already using my site as UTF-8. So second attempt for the UTF-8 might be the problem. I defined a new function for myself and problem solved. Put this function to your theme’s functions.php file:

    //feed character correction function by
    function rssfeedcharcorrection() {
    global $activities_template;

    if ( !empty( $activities_template->activity->action ) )
    $content = $activities_template->activity->action;
    $content = $activities_template->activity->content;

    $content = explode( ‘<span', $content );
    $title = trim( strip_tags( html_entity_decode( $content[0] ) ) );

    if ( ‘:’ == substr( $title, -1 ) )
    $title = substr( $title, 0, -1 );

    if ( ‘activity_update’ == $activities_template->activity->type )
    $title .= ‘: ‘ . strip_tags( bp_create_excerpt( $activities_template->activity->content, 15 ) );

    return apply_filters( ‘rssfeedcharcorrection’, $title );
    add_filter(‘bp_get_activity_feed_item_title’, ‘rssfeedcharcorrection’);

    That’s all! And let me know if this works for you too…

    Wow! I’m becoming a better developer every single day :) I think I’m gonna rock BP community soon… :D

    Ali Erkurt


    I also developed my first plugin for this issue :) It’s gonna be published soon I think.. It’ll be added to the Plugins directory as soon as it’s on air.


    If I remember correctly, if you call html_entity_decode() with some character format text on PHP4 (latin1?), there is a log warning, “cannot yet handle MBCS in html_entity_decode().”

    You’re probably best putting this as a bug on so that someone can investigate

    Ali Erkurt


    @minniwelt OK, you can download and activate the plugin to fix your rss issue. I fixed myself with that way. Here’s the link:




    great work! installed the plugin and it works! was trying to fix this problem for a while now :-)



    Please read here. There are also patches on trunk now:

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Corrupted Turkish characters on RSS Feed’ is closed to new replies.
Skip to toolbar