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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -