encoding problems
Moderator: General Moderators
-
AndrewBliss
- Forum Newbie
- Posts: 7
- Joined: Mon Oct 05, 2009 4:24 pm
encoding problems
Hi, I am new to this site. I am having a problem with display UTF-8 characters on my website. I have tried most of the suggestions from google searches. Such as putting the meta html tag, the php header function. Nothing seems to help. A test case is when I put the ó character in a static html page it displays normal but when I run it threw just php and not the browser it changes the character to ó. The problems come up with I save the ó character in the mysql database and the page displays question marks like it doesn't know what it is. I am not too familiar with all this character stuff. Any help would be appreciated. Thanks.
Re: encoding problems
we need to see the code bro.
-
AndrewBliss
- Forum Newbie
- Posts: 7
- Joined: Mon Oct 05, 2009 4:24 pm
Re: encoding problems
Sorry I didn't post any code. Here is the page.
<?
ini_set('default_charset', 'utf-8');
header ('Content-type: text/html; charset=utf-8');
$r = mysql_connect('*****', '*****', '*****', true);
mysql_select_db('*****', $r);
$sql = "select name from ***** where name like ' Edu%'";
$result = mysql_query($sql);
$var = 'Educación Física y su didáctica';
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?
while($row = mysql_fetch_array($result))
{
echo $row['name'].'<br/>';
}
?>
</body>
</html>
It outputs this: Educaci�n F�sica y su did�ctica
<?
ini_set('default_charset', 'utf-8');
header ('Content-type: text/html; charset=utf-8');
$r = mysql_connect('*****', '*****', '*****', true);
mysql_select_db('*****', $r);
$sql = "select name from ***** where name like ' Edu%'";
$result = mysql_query($sql);
$var = 'Educación Física y su didáctica';
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?
while($row = mysql_fetch_array($result))
{
echo $row['name'].'<br/>';
}
?>
</body>
</html>
It outputs this: Educaci�n F�sica y su did�ctica