[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

My SQL showing icons in place of Feet or ft

Posted on 2013-01-15
4
Medium Priority
?
240 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

656 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