WordPress and special chars(double minus/hyphen, ampersand, etc)

For the post Ubuntu and my Canon IXUS 850IS in gThumb I needed to enter two hyphens (gthumb --import-photos). So I simply typed it in the wordpress editor, nothing evil thinking in the visual editor. The result was one dash instead of two hyphens: gthumb --import-photos. Not even the code view respected my wish.

With my HTML knowledge I thought the easiest way would be to enter the character code of the hyphen (-). This simply worked. If you edit your post you have to replace them again. 😦

Note: To enter - I had to type in #45. Puh that’s a bit annoying, most notable when you edit the post and the same game begins again 😦

Note2: As I see now there are much more problems, than the double hypen. Iy ou want to type in an ampersand or another special character you have to enter the HTML-Code everytime you edit the post. E.g wordpress replaces my #45 everytime I edit the post with a hypen (-) 😯
Does anbody know, how I can turn off this AI? (Is it possible on www.wordpress.com too?


10 Responses to “WordPress and special chars(double minus/hyphen, ampersand, etc)”

  1. 1 Julien April 13, 2007 at 6:17 pm

    I suffer from the same issue regularly, and haven’t found any reliable for the moment.

    I am planning to look deeper in the code and avoid the replacement onl in and tags, which would allow us to easily write code in our posts, without having to write all the posts in pure (x)HTML

    Please let me know if you find omething in the meantime


  2. 2 Julien April 13, 2007 at 6:21 pm

    This was actually pretty easy, and already existing for , which I don’t use a lot.
    See the following patch to apply to wp-includes/formatting.php:

    — formatting.php.orig 2007-04-13 19:20:07.000000000 +0200
    +++ formatting.php 2007-04-13 19:19:26.000000000 +0200
    @@ -32,7 +32,7 @@

    // regular expressions
    $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
    – } elseif ( strstr($curl, ‘

  3. 3 ataub2qf April 15, 2007 at 11:33 am

    Thanks! 🙂 I have the blog now on wordpress.com so I can not edit the files without paying I think.

    Maybe I will switch back to my private server and test it but for now I hope that I do not have to post something where I need special chars.

  4. 4 Yvonne Finn April 24, 2008 at 6:36 pm

    Thank you so much!
    Sometimes the simplest is the best.
    I had been trying many of the more complex codes for the “hyphen” and the code you gave (-) was the one that worked in the long run.
    Much appreciated!

  5. 5 spsneo August 9, 2008 at 6:21 pm

    its not working with me

  6. 6 vsevorotax.ru May 24, 2009 at 3:30 am

    Распашные ворота изобретены по той же технологии что и откатные ворота, только при этом имеют перечень отличительных признаков и технических решений. Область использования распашных ворот довольно широка, дачи, коттеджи, промышленные объекты, строительные сооружения общественного назначения. Узнать абсолютно все про гаражные ворота, автоматические секционные гаражные ворота, распашные ворота, высокоскоростные раздвижные ворота, доклевеллеры механические и многое другое Вы всегда сможете на нашем сайте.
    Автоматические шлагбаумы

  7. 7 Olort February 18, 2010 at 8:26 pm

    У нас в Дагестане за такие слова могут и камням изакидать 😦

  8. 8 Новости -prnews June 30, 2010 at 11:59 am

    Предлагаю объединиться и обсудить эту не навясчивую тему

  9. 9 Ferodynamics November 5, 2010 at 10:13 pm

    Julien’s suggestion helped me.

    Comment out $curl = str_replace(blah blah blah

  10. 10 Duco November 12, 2010 at 12:37 am

    Thank you, it helped me a lot!

Comments are currently closed.

%d bloggers like this: