Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    This is still a problem with your character set.
    At the very start of your page, before any output, add header("Content-type: text/html; charset=utf-8");. It has to be before any output in order to have an affect (or have ini/perdir setting for output buffering enabled).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  2. #17
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    I insert data into the database manually <-- theres your problem

    inserting an apostrophe need to be entered with a backslash

    Code:
    I have spent today\’s afternoon at Naro-Moru Primary School,
    mysql_real_escape_string() does this for any characters that it needs to automatically
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  3. #18
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    also read this about retrieving safe data from the database

    http://php.net/manual/en/function.htmlspecialchars.php
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  4. #19
    New Coder
    Join Date
    Sep 2012
    Posts
    87
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Exclamation Problem Persists

    This character �, which is appearing on a webpage everywhere there is supposed to be a single quote, is giving me headaches. The data is being displayed from a database. I've followed advice from previous posts but none is working: changing fonts, putting a header with charset as utf-8. My db collation is utf8-bin. How do I make the single quote appear?

  5. #20
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Fix your byte order marker problem yet? Until you do that, the charset won't work when used with a header.
    Upload a copy of the file saved as .txt.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  6. #21
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by Thuita Maina View Post
    This character �, which is appearing on a webpage everywhere there is supposed to be a single quote, is giving me headaches. The data is being displayed from a database. I've followed advice from previous posts but none is working: changing fonts, putting a header with charset as utf-8. My db collation is utf8-bin. How do I make the single quote appear?

    you need to enter a bachslash before every single quote in your data
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  7. #22
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,479
    Thanks
    0
    Thanked 635 Times in 625 Posts
    The character you are trying to use is a curved quote and not the straight ' character.

    Either replace the ’ with a ' or with &#8217; (which is the entity code for that fancy quote mark)
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  8. #23
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    your not listening, you cant input a quote into a database without a backslash because you get problems, hence the reason your here
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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