Ajax AutoComplete Support Product Page

????? instead of èòàùì

Reported 26 Feb 2012 17:47:01
1
has this problem
26 Feb 2012 17:47:01 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 26 Feb 2012 20:21:40
26 Feb 2012 20:21:40 Teodor Kuduschiev replied:
Hello,

Please provide a link to your page.
Replied 27 Feb 2012 08:02:44
27 Feb 2012 08:02:44 tuteri marco replied:
Replied 27 Feb 2012 09:30:38
27 Feb 2012 09:30:38 Teodor Kuduschiev replied:
Your page has:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

Encoding. It should be the same as your database - utf-8
Replied 27 Feb 2012 12:10:34
27 Feb 2012 12:10:34 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
Replied 30 Mar 2012 15:38:26
30 Mar 2012 15:38:26 christian verdirame replied:
the same problem in ASP. How can i resolve it?
Replied 02 Apr 2012 07:28:21
02 Apr 2012 07:28:21 Teodor Kuduschiev replied:
Hello christian,

Please provide a link to your page.
Replied 27 Jul 2012 14:58:10
27 Jul 2012 14:58:10 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());
}
?>

Reply to this topic