charaters from geoname UTF8 table display as latin1 - how to correct this?
Posted by: Ivan Gutschy
Date: March 10, 2011 03:29PM


First to say that I am using Linux CentOS with Cpanel and MySql.

I have acquired geoname tables for countries and cities. They are set as utf8 tables. So I have imported them as utf8. most od other tables were created as default latin1.
And in phpmyadmin i see characters as they should be.

The problem is when i am displaying them on my website.
I have set
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
in my header. Other tables (the ones with latin1) are displaying characters correctly, alghough they are stored differently.

i have tried with
as well as
mysql_query("SET NAMES 'utf8'", $dbc);
but nothing changed.

this is block of code that selects countries and then cities based on country selection
$kveri="SELECT ccode FROM all_countries WHERE country_name = '$country_sel'";
$kveri_result = mysqli_query($dbc, $kveri);
$row=mysqli_fetch_array($kveri_result, MYSQLI_ASSOC);

$qc="select * from gradovi where ccode='$ccode' ORDER BY city ASC ";
$rc=mysqli_query($dbc, $qc);
// $rc = mb_convert_encoding($rc, "UTF-8");
while($row=mysqli_fetch_array($rc, MYSQLI_ASSOC))
foreach($citys as $k=>$value)

Any help is appreciated. I am not an expert programmer as you can see so I ask for your patience.

Thank you.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.