Ajax AutoComplete Support Product Page
????? instead of èòàùì
Reported 13 years ago
1
has this problem
13 years ago tuteri marco posted:
I take my autocomplete data from a mysql database.
collation (coding) of the column of my database view is utf8_general_ci .
the page (php) with the form has <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
there are problems with displaying éàìà. I see these letters as ????
how can I correct this?
sorry for my english
regards
Replies
Replied 13 years ago
13 years ago Teodor Kuduschiev replied:
Hello,
Please provide a link to your page.
Please provide a link to your page.
Replied 13 years ago
13 years ago tuteri marco replied:
Replied 13 years ago
13 years ago Teodor Kuduschiev replied:
Your page has:
Encoding. It should be the same as your database - utf-8
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
Encoding. It should be the same as your database - utf-8
Replied 13 years ago
13 years ago tuteri marco replied:
thanks for your quick reply Teodor,
I changed the coding for testing, in this page
www.2727.it/ditta/test/ancora.php
I restored <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
but as you can see it does not work.
I solved this with this code:
$fields = implode(',',array_map('convert',$fields));
mysql_query('set names utf8'); // NEW CODE
$sql = 'SELECT '.$fields.' FROM `'.$table.'`';
thanks
I changed the coding for testing, in this page
www.2727.it/ditta/test/ancora.php
I restored <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
but as you can see it does not work.
I solved this with this code:
$fields = implode(',',array_map('convert',$fields));
mysql_query('set names utf8'); // NEW CODE
$sql = 'SELECT '.$fields.' FROM `'.$table.'`';
thanks
Replied 13 years ago
13 years ago christian verdirame replied:
the same problem in ASP. How can i resolve it?
Replied 13 years ago
13 years ago Teodor Kuduschiev replied:
Hello christian,
Please provide a link to your page.
Please provide a link to your page.
Replied 12 years ago
12 years ago Greta Garberini replied:
had the same issue with German Umlauts. What helped me was to add two lines after the database connection string from dreamweaver:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_yourname = "localhost";
$database_yourname = "yourname";
$username_yourname = "yourlogin";
$password_yourname = "yourpassword";
$yourname = mysql_pconnect($hostname_yourname, $username_yourname, $password_yourname) or trigger_error(mysql_error(),E_USER_ERROR);
$result0 = mysql_query('SET NAMES utf8');
if (!$result0) {
die('invalid request: ' . mysql_error());
}
?>
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_yourname = "localhost";
$database_yourname = "yourname";
$username_yourname = "yourlogin";
$password_yourname = "yourpassword";
$yourname = mysql_pconnect($hostname_yourname, $username_yourname, $password_yourname) or trigger_error(mysql_error(),E_USER_ERROR);
$result0 = mysql_query('SET NAMES utf8');
if (!$result0) {
die('invalid request: ' . mysql_error());
}
?>