jowdilla Posted January 30, 2012 Share Posted January 30, 2012 Hi, I'm making my website, everything is going well, but now I found something weird... some characters cant display and appear like this: � I let an image here, as we know, image is worth a thousand words, so here it goes. Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/ Share on other sites More sharing options...
Adam Posted January 30, 2012 Share Posted January 30, 2012 It's a character set issue. You should use UTF-8 to ensure all (or at least most) characters are rendered correctly. It could either be in the file itself - most editors have an option to convert to UTF-8 - or the browser rendering it. Add the following META tag and see if it fixes the issue: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312686 Share on other sites More sharing options...
jowdilla Posted January 30, 2012 Author Share Posted January 30, 2012 Thanks for fast reply, but I have precisely that line in the begining of my main page, but I dont have it in my PHP scripts that Ive included in my Main page. hm, what else can I try? Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312688 Share on other sites More sharing options...
Adam Posted January 30, 2012 Share Posted January 30, 2012 As I said, the HTML may be stored incorrectly in the actual file itself. Which editor are you using? Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312691 Share on other sites More sharing options...
jowdilla Posted January 30, 2012 Author Share Posted January 30, 2012 I'm using Dreamweaver CS5 right now. My main code is here: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("logincarlacaessa") or die(mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Tarot Online - Carla Caessa</title> <link href="estilobase.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="1024" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td colspan="3" height="97px" background="images/tarotcctemplate_CORTADO_LAYOUT_01.png"> </td> </tr> <tr> <td width="163" rowspan="3" background="images/tarotcctemplate_CORTADO_LAYOUT_02.png"> </td> <td valign="top" width="487" height="26"> <?PHP require_once "menu_principal.php" ?></td> <td width="374" rowspan="3" background="images/tarotcctemplate_CORTADO_LAYOUT_04.png"> </td> <!--COLUNA LATERAL DIREITA--> </tr> <tr><!--ROW ABAIXO DO MENU PRINCIPAL - ESPAÇO DEDICADO AO LOGIN--> </tr> <tr> <td height="339" background="images/tarotcctemplate_CORTADO_LAYOUT_05.png" valign="top"> <table width="487" border="0" cellspacing="0" cellpadding="0"> </table> <table width="487" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="20"> </td> <td width="447"><?PHP require_once "registo\index.php" ?></td> <td width="20"> </td> </tr> </table> </td> </tr> <tr> <td background="images/tarotcctemplate_CORTADO_LAYOUT_06.png">março</td> <td height="515" background="images/tarotcctemplate_CORTADO_LAYOUT_06-07.png"> </td> <td background="images/tarotcctemplate_CORTADO_LAYOUT_08.png"> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000"> <tr> <td height="100"> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312694 Share on other sites More sharing options...
spiderwell Posted January 30, 2012 Share Posted January 30, 2012 use &Ccidill; http://www.w3.org/MarkUp/html3/latin1.html Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312696 Share on other sites More sharing options...
jowdilla Posted January 30, 2012 Author Share Posted January 30, 2012 use &Ccidill; http://www.w3.org/MarkUp/html3/latin1.html What you mean? Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312698 Share on other sites More sharing options...
spiderwell Posted January 30, 2012 Share Posted January 30, 2012 puttin the html entity instead of the actual character will prevent the question marks appearing. click on the link to see many examples like cidilla, acute, grave, the one with 2 dots over an O etc Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312701 Share on other sites More sharing options...
jowdilla Posted January 30, 2012 Author Share Posted January 30, 2012 But Im not figuring out what to apply and where, can you be me more specific? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312702 Share on other sites More sharing options...
spiderwell Posted January 30, 2012 Share Posted January 30, 2012 you will have to look at the raw data in the database and look for characters which are where the question mark are in the final html, and replace those. Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312747 Share on other sites More sharing options...
Drongo_III Posted January 30, 2012 Share Posted January 30, 2012 As the others have said, using the html entity will fix it in most cases and is probably the best way. I have had this issue a few times when copying text from word (even with the charset set as utf . I notice it happens on commas and apostrophes and sometimes the simplest fix is to delete the character and re-write it in your editor, which fixes the comma and apostrophe issue. Hi, I'm making my website, everything is going well, but now I found something weird... some characters cant display and appear like this: � I let an image here, as we know, image is worth a thousand words, so here it goes. Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312754 Share on other sites More sharing options...
jowdilla Posted January 30, 2012 Author Share Posted January 30, 2012 Many thanks to all, after read all of your comments I did start to check every pixel in the code... I found that some pages were SET to Ocidental Europe instead of my default UTF-8. With that done my problems were gone. I even added header("Content-Type: text/html; charset=UTF-8",true); in some pages to remove the bugs in chrome and IE. Problem solved! PEACE brothers. Quote Link to comment https://forums.phpfreaks.com/topic/256057-%EF%BF%BD-whats-this/#findComment-1312756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.