3 Replies Latest reply: Apr 10, 2013 6:53 AM by mhollis55 RSS

    I am getting ? when I want £

    matthew stuart Community Member

      I have got a website with LOADS of the British pound symbol '£' all over it, rather than £ which is held in the database rather than hard coded n the page.

       

      I've got on all pages the <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> to translate to the correct symbol. I have looked in the admin section of the site and the text and textarrea boxes all have ? instead of £. If I change it to a pound, then it displays correctly on the site.

       

      What I think is causing this is I have exported the database and loaded it on the remote server, and I think it's the export and import process that's changing the £ to a character that MySQL doesn't recognise. Is this the case? If so, how can I stop it?

       

      Thanks.

        • 1. Re: I am getting ? when I want £
          osgood_ CommunityMVP

          matthew stuart wrote:

           

          I have got a website with LOADS of the British pound symbol '£' all over it, rather than &pound; which is held in the database rather than hard coded n the page.

           

          I've got on all pages the <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> to translate to the correct symbol. I have looked in the admin section of the site and the text and textarrea boxes all have ? instead of £. If I change it to a pound, then it displays correctly on the site.

           

          What I think is causing this is I have exported the database and loaded it on the remote server, and I think it's the export and import process that's changing the £ to a character that MySQL doesn't recognise. Is this the case? If so, how can I stop it?

           

          Thanks.

           

          So what's in the database field - &pound; or £?

           

          When you exported and imported to the database was it £ or &pound;?

           

          Try deleting one of the &pound; in the database and physically typing it in there and then testing it by calling it onto the page via the database.

           

          I experience weird characters a lot if I insert text directly into a database which has been provided in word or pdf format.

           

          The pounds usually show up as black diamonds with a ? mark in them if they are incorrectly input into a database from what I can recall from memory

          • 2. Re: I am getting ? when I want £
            Ben Pleysier CommunityMVP

            I think it unwise to have the currency symbol in the database. In doing so, it needs to be a text field (or similar) eliminating any chance of mathematical operations.

             

            It is far better to create a function that shows currencies with the relevant symbol.

            • 3. Re: I am getting ? when I want £
              mhollis55 CommunityMVP

              One thing you can do is to have php print the appropriate string every time it encounters that character.

               

              So your php would see £ and print &pound;