Solved

My SQL showing icons in place of Feet or ft

Posted on 2013-01-15
4
229 Views
Last Modified: 2013-01-16
Hello
I am in the process of converting a .asp/access website, to a php/Myqsl website.

I have exported the access tables to MySql and the tables look OK

When I look at some of the text now in php I notice a number of Question Mark Icons where
feet has been written as '
inches as "
pound as £
Resulting in this
 - ¿2995 Type: Newbridge Navigator: GRP Bilge Keel Cruiser. Built Newbridge Marine 1985 1 Double Berth + 2 Single Berth LOA 19¿ (5.8m) Beam 7¿ 8¿ (2.34m) Draft 2¿ (0.6m)
Does anyone know how this can be rectified?

Strangely is was not a problem when using .asp
Many thanks for any help

John
0
Comment
Question by:johnhardy
4 Comments
 
LVL 11

Assisted Solution

by:Slimshaneey
Slimshaneey earned 125 total points
ID: 38778783
Looks like you have the wrong character set, either on the server serving the page, or more likely MySQL is using a table with storage set to something that doesnt support those characters. Try setting the storage for the tables to UTF8, and reinsert the data.

Read some more into the issue here:
http://www.bluebox.net/about/blog/2009/07/mysql_encoding/
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 250 total points
ID: 38778906
The storage of the data might be okay, while the display of that data might be screwed up.

The browser gets a raw stream of bytes when it asks for a web page. It has no idea what those bytes are - it might be a photo or a PDF or a web page. So you have to send headers to tell the browser how to interpret the information that you're sending. PHP, ASP, Apache, etc... can all try to GUESS at the content but it's not always 100% right. For example, PHP may guess that you're trying to send a regular web page with no special characters, so it sends a header that's like this:

Content-Type: text/html

The browser gets this and figures there's no special characters in the document. So when it comes across a couple of bytes that SHOULD be interpreted as special characters (like a British pounds sign), it just displays those raw bytes instead of processing them.

You can help instruct the browser by telling it to follow a character set (UTF-8 is the most common). Let's say this is the very top of your PHP page:

<?php
blah blah
...
?>

Just insert a new header() command to force the sending of UTF-8 content:

<?php
header("Content-Type: text/html; charset=UTF-8");
blah blah
...
?>

Then try and see if that fixes it. If not, you may also have to add meta tags to your page's <head> area:

<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
0
 
LVL 9

Assisted Solution

by:crazedsanity
crazedsanity earned 125 total points
ID: 38782959
You can try a different charset if UTF-8 doesn't work: "iso-8859-1".  Some good reads on the topic:
 * http://blog.salientdigital.com/2009/06/06/special-characters-showing-up-as-a-question-mark-inside-of-a-black-diamond/
 * http://www.joelonsoftware.com/articles/Unicode.html
0
 

Author Closing Comment

by:johnhardy
ID: 38783222
Many thanks for all the help.
I did in fact close this item previously but it seems not to have updated. No matter I have now sorted out my main problem and will work on it a bit further to iron out a few oddities.
Regards
John
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now