php - Wordpress - wpdb ->get_results - wrong encoding -
i have wordpress installation , custom table in wp database called c_schools. inside custom template page, following query:
$schools = $wpdb->get_results("select school_id, school_name c_schools order school_id"); and write results html list.
the school names contain czech symbols, such ě, š, not displayed properly.
the encoding of whole database (including custom table) utf8, collation utf8_general_ci.
when run query in mysql application in terminal via putty session, characters display fine.
the rest of page displays fine, including name of page in menu, contains these symbols , (i believe) loaded same database.
when examining response headers via firebug, found following content-type:
content-type text/html; charset=utf-8 so seems error in php script on server side, perhaps wpdb not configured properly?
what doing wrong?
i used advice found on this page , verified encodings of database, table , column utf8.
i have found following lines in wp-config.php, seem correct.
/** database charset use in creating database tables. */ define('db_charset', 'utf8'); /** database collate type. don't change if in doubt. */ define('db_collate', ''); the following meta tag present in head part of page.
<meta charset="utf-8" />
Comments
Post a Comment