WordPress.org

Ready to get started?Download WordPress

Forums

CurlyEnc (3 posts)

  1. JoshuaStreet
    Member
    Posted 9 years ago #

    I was having trouble with copying and pasting content from a word processor (in my case primarily OpenOffice, but Word does it as well) into WordPress due to its smartquote conversion. WordPress generally handles curly quotes just fine... when you're using quotation marks, not pre-encoded smartquotes (curly quotes).

    So I whipped up this plugin (I've called it CurlyEnc) quickly, which basically converts these smart quotes to proper HTML entities (“ and &$8221;) instead of just leaving them like WP (or is that Kses?) normally does.

    I'd have edited the Kses file, but plugins work across versions and don't get damaged between upgrades as easily, so... yes. This is better ;)

    Having said that, I'm no character-encoding expert, so feedback from the pros is more than welcome. I'm convinced there's a better/more reliable way to do it - it works fine on my weblog, but I copied and pasted the magic quotes in, so I'd guess that someone not using UTF-8 may potentially run into trouble.

    Anyway, I couldn't find anything else that does what this does - if you're interested, take a look.

  2. Denis de Bernardy
    Member
    Posted 9 years ago #

    Aye, useful. It would be nice if it did the single quotes as well. :)

  3. JoshuaStreet
    Member
    Posted 9 years ago #

    Done. It also does a whole heap of symbols and various international characters ("international" from an English-speaking perspective, anyway - I'm sure there's another term for it).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags