WordPress.org

Ready to get started?Download WordPress

Forums

Characters being rendered with replacements (3 posts)

  1. groovejuice
    Member
    Posted 8 years ago #

    I've imported my db into a new installation of 1.5 and everything is smooth except for single quote/apostrophes being displayed as question marks. I've searched the forums and found several related posts, but none of the solutions have worked. This is especially problematic because the question marks come up as errors when I valaidate the rss feed. Please help!

  2. groovejuice
    Member
    Posted 8 years ago #

    Any takers? Please?

  3. aral
    Member
    Posted 7 years ago #

    I saw this when migrating from b2 to WordPress. It has to do with smart quotes being present in the original data. WP doesn't seem to like this (it has its own built-in smart quote conversion that handles this during rendering.)

    I'm in the process of completing the migration script I'm writing for b2 to WP and will release it when its done. In the meanwhile, though, here's the code I'm using the get rid of this issue:

    // Convert smart quotes to simple quotes
    function smartToSimpleQuotes ( $str )
    {
    $str = str_replace('“', '\"', $str);
    $str = str_replace('”', '\"', $str);
    $str = str_replace('‘', "\'", $str);
    $str = str_replace('’', "\'", $str);

    return $str;
    }

    (That function, run on each post, during migration.)

Topic Closed

This topic has been closed to new replies.

About this Topic