Forums

Weird Chars ’ (5 posts)

  1. Rub3X
    Member
    Posted 5 years ago #

    I keep getting ’ and other things in my posts. WordPress is replacing - ' and " with other weird things. How do I disable this and fix all my posts?

  2. makemead
    Member
    Posted 5 years ago #

    What happens if you change your text encoding to utf-8?

  3. Rub3X
    Member
    Posted 5 years ago #

    It's already at UTF-8. =\

  4. Rub3X
    Member
    Posted 5 years ago #

    Ok for anyone with this issue I found this:

    http://www.moskalyuk.com/blog/removing-curly-quotes-from-wordpress-20/

    Open

    $curl = preg_replace("/'s/", '’s', $curl);
    $curl = preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl);
    $curl = preg_replace('/(\s|\A|")\'/', '$1‘', $curl);
    $curl = preg_replace('/(\d+)"/', '$1″', $curl);
    $curl = preg_replace("/(\d+)'/", '$1′', $curl);
    $curl = preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl);
    $curl = preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl);
    $curl = preg_replace('/"(\s|\S|\Z)/', '”$1', $curl);
    $curl = preg_replace("/'([\s.]|\Z)/", '’$1', $curl);
    $curl = preg_replace("/ \(tm\)/i", ' ™', $curl);
    $curl = str_replace("''", '”', $curl);

    Open wp-includes/functions-formatting.php and comment out those lines. Also avoid using MS office, because apps like that use those as well. Try editing in note/wordad or the WP editor.

    Now..does anyone know how to remove all previous posts that have those chars in it? A simple find replace query won't work, it has SQL errors idk why. Using a text editor won't work either =\

  5. andyhowardidau
    Member
    Posted 5 years ago #

    I'm having the same issue, and have followed the updated fix for WordPress 2.1 outlined at:

    http://mhinze.com/remove-curly-quotes-from-wordpress-21/

    No love - still having this problem, see screeny.

    I have 'Reading' set to 'UTF-8' in WP Admin, and I'm calling this setting in header.php as per this post. The mySQL collation is utf8_unicode_ci.

    Note: This is only an issue for posts that were copied and pasted from Word, but I've only had this problem since migrating to (mt) - (mt) is running an older version of mySQL than my previous host.

    Anyone know how to remove these 'special' characters?

Topic Closed

This topic has been closed to new replies.

About this Topic