Results 1 to 3 of 3

Thread: Characters Encoded Incorrectly

  1. #1
    Join Date
    Feb 2011

    Cool Characters Encoded Incorrectly

    Hi guys, really hoping someone can help me out because I'm pulling my hair out over this!!

    My boss keeps writing texts in Word and forwards it on to me to post to our website which I've built but when he puts apostrophies in, they get turned into the wierd characters. The text is inserted into a database by PHP and the apostrophy looks like this in the database... ’

    I am posting the input to the db in the following way...
    PHP Code:
    mysql_query("INSERT INTO table VALUES (
    ) or die (mysql_error()); 
    Hope someone can help...

    Thanks in advance


  2. #2
    Join Date
    Aug 2004
    Something I came up with some time ago you could try: http://www.charles-reace.com/blog/20...-ms-word-text/

    Note that in this function I also handle the characters converted by htmlspecialchars(), so you don't want to use it in conjunction with that function (or with htmlentities(), for that matter).
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Feb 2011
    wow thanks Nogdog for a quick response...

    I posted this question on a different forum last night and hadn't had a response back until funny enough just before you! I was told to try this...

    PHP Code:
    It works for the apostrophy I was having trouble with, but I think I'll make use of the function on the page you linked also just incase any other wierd characters end up in there!!

    Thanks again

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center