Support » Fixing WordPress » Stop wordpress converting my characters

  • I’ve been using wordpress with UTF-8 from day one, but it keeps on converting my non US-ASCII characters to character entities. It’s frustrating, because first of all, it’s not needed, not in UTF-8 nor with many characters in other charsets, and second of all, because instead of taking up maybe one or two bytes, it takes up many more. A waste of bandwidth, in other words. If you don’t know what I’m talking about, I’ll give you an example. Even normal characters like apostrophes get converted:
    “I’ll be home by midnight” becomes “I& #8217;ll be home by midnight”
    when you view it in a browser. So my question is, how do I turn this behavior off? It really annoys me, and I’m not that good in PHP, so could anyone help me please?

Viewing 6 replies - 1 through 6 (of 6 total)
  • It’s strange, because I use a lot of non US-ASCII characters (even my commenters do), and in my testing period I’ve tried even other alphabets than the Latin and it worked perfectly!
    Are you by any chance copying your posts from a word processor that encodes the text differently than utf?
    Or are you using any of the textile/markdown plugins? I remember some posts about those screwing up the characters…
    If I find them I’ll post back.

    No, I haven’t enabled any plugins, and I’m just typing the text directly into the browser (Moz Firefox) and I’m sure it’s set to UTF-8 while posting. It may make a difference that I don’t run Apache, but IIS, but I’m still kinda confused why that should matter, because the PHP shouldn’t really be too dependant on which server it runs, after all it’s just fed GET and POST values, and sends back output, nothing else…

    Well, apostrophes get converted in typographic (“curly”) apostrophes. What does the site look like? Can we have a URL?

    If you want to turn this off in WP, in the /wp-includes directory look for vars.php. At the end of that file you’ll see:
    // Some default filters
    following this are a number of function calls to add_filter(). Just comment out (place two slashes at the start of the line) the ones you don’t want to use, like so:
    // add_filter('the_content', 'wptexturize');

    It’s in your index.php.

    DarkPhoenix: <cite>I dunno why anyone would want right single quotes for apostrophes, as this is syntactically wrong. At least I think it is.</cite>
    Just for the sake of completeness, it isn’t typographically wrong (syntax has nothing to do with it): As a quick look through my bookshelf shows me, typesetters have long adopted a curly form for apostrophes, which, except in typography of an exceptionally high degree of refinement, is identical to that of the English closing single quote.
    As for the other line, Anonymous is right: It should be “hard-coded” in your index.php.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.