Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Easy Date   ClickBooth Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 01-08-2007, 11:30 AM   #1 (permalink)
Inactive
 
jeet's Avatar
 
Join Date: 03-04-06
Posts: 181
iTrader: 0 / 0%
jeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the rough
Please tell me how to remove these characters.

Hi,
In a DB of mine, some characters when echoed to webpage show up like this:


That should be displayed as - sign.
How do I fix this problem?

If I am right, this comes up when the CharacterSet is not defined or proper output header is not set.
So I tried setting "text/html" header using php, didn't work.
Then I tried the following meta info, didn't work either.
<meta http-equiv="Content-Type" content="text/html; charset=utf8">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

None of those worked.
What am I doing wrong?
Thanks for helping.
Bye
jeet is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 01-08-2007, 11:50 AM   #2 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,067
iTrader: 0 / 0%
Latest Blog:
Moved In!

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
You could simple do the function htmlspecialchars() (http://us3.php.net/manual/en/functio...cialchars.php). Basically, what that does is any letter not a letter, like your '-' sign, would become a ASCII text in the database. Then when you want to output the info, it will come out as a '-' sign

EDIT- After rereading the problem, I noticed something. You said the characters are going in fine to the database as a '-' sign? But when you echo it, it's coming at as —? If so, I've never seen this before and is really strange. Again, I would try using the above suggestion I made and see if that works.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!

Last edited by Izzmo : 01-08-2007 at 12:03 PM.
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 12:00 PM   #3 (permalink)
v7n Mentor
 
Taltos's Avatar
 
Join Date: 11-22-06
Location: Phoenix, AZ
Posts: 1,798
iTrader: 0 / 0%
Latest Blog:
None

Taltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web pro
Send a message via Yahoo to Taltos
That sounds strange. What type of field is it in the database? And what dB? MySQL? And are you just using PHP's echo to display it?
__________________
Experimenting
Taltos is online now  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 12:27 PM   #4 (permalink)
Inactive
 
jeet's Avatar
 
Join Date: 03-04-06
Posts: 181
iTrader: 0 / 0%
jeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the rough
It's either varchar, or text fields.
To print I use either "print", or "echo" commands, depending on the amount of lines I have to print/echo...
I will try the htmlspecialchars and let you know here if it works...
Thanks
jeet is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 12:38 PM   #5 (permalink)
Inactive
 
jeet's Avatar
 
Join Date: 03-04-06
Posts: 181
iTrader: 0 / 0%
jeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the rough
Tried htmlspecialchars, but it didn't work either.
Still getting the same output.
The code used was:
$st= htmlspecialchars($st, ENT_QUOTES);
echo $st;

I think it's more of a CharacterSet problem than php conversion...
jeet is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 12:43 PM   #6 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,067
iTrader: 0 / 0%
Latest Blog:
Moved In!

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Yes, it must be something with either A) Your browser B) Your webpage (not php) or C) Output settings
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 12:59 PM   #7 (permalink)
Inactive
 
jeet's Avatar
 
Join Date: 03-04-06
Posts: 181
iTrader: 0 / 0%
jeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the roughjeet is a jewel in the rough
Fixed it!!!
This tag did it:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

I was previously using:
<meta http-equiv="Content-Type" content="text/html; charset=utf8">

Minor, but stupid mistake...
Thank you
jeet is offline  
Add Post to del.icio.us
Reply With Quote
Old 01-08-2007, 02:39 PM   #8 (permalink)
v7n Mentor
 
Taltos's Avatar
 
Join Date: 11-22-06
Location: Phoenix, AZ
Posts: 1,798
iTrader: 0 / 0%
Latest Blog:
None

Taltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web pro
Send a message via Yahoo to Taltos
Sounds good. You could tell it was a double byte character issue because you got 2 for 1. Good job! And thanks for giving the answer too!!
__________________
Experimenting
Taltos is online now  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Greek Characters from database.. itHighway Coding Forum 0 02-20-2008 03:23 AM
Maximum characters? devilzfan300 Coding Forum 3 11-24-2006 08:49 AM
2 characters domains lordspace Domain Name Forum 7 07-19-2006 02:46 AM
counting characters in javascript ali-gates Coding Forum 0 05-10-2005 05:39 AM
help extra characters appear! LazyJim Coding Forum 10 02-02-2004 04:01 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:22 PM.
© Copyright 2008 V7 Inc