?
Solved

My SQL showing icons in place of Feet or ft

Posted on 2013-01-15
4
Medium Priority
?
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Assisted Solution

by:Slimshaneey
Slimshaneey earned 500 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 35

Accepted Solution

by:
gr8gonzo earned 1000 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 500 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

764 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