Ben mysql sorgu içindeki charset dönüştürme hakkında bir sorum var.
I have a 2 databases. One for the website (joomla), the other for forum (IPB). I am doing query from inside joomla, which by default have "SET NAMES UTF8". I want to query a table inside the forum databases. A table called "ibf_topics". This table has latin1 encoding.
Ben değil-utf8 tablodan bir şey seçmek için aşağıdakileri yapın.
//convert connection to handle latin1.
$query = "SET NAMES latin1";
$db->setQuery($query);
$db->query();
$query = "select id, title from other_database.ibf_topics";
$db->setQuery($query);
$db->query();
//read result into an array.
//return connection to handle UTF8.
$query = "SET NAMES UTF8";
$db->setQuery($query);
$db->query();
Ben seçilen fayans kullanmak istediğiniz zaman Bundan sonra, ben aşağıdakileri kullanın:
echo iconv("CP1256", "UTF-8", $topic['title'])
The question is, is there anyway to avoid all this hassle? For now, I can't change forum database to UTF8 and I can't change joomla database to latin1 :S