Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   [SOLVED] Cyrillic characters become '???' (question marks) (http://forum.bytesforall.com/showthread.php?t=17252)

ymf Apr 9, 2012 07:10 AM

[SOLVED] Cyrillic characters become '???' (question marks)
 
Weird. A comment in Russian I wonder if it's the theme, or something else in WP?

juggledad Apr 9, 2012 08:31 AM

it shows all ? marks on both links

ymf Apr 9, 2012 09:21 AM

Quote:

Originally Posted by juggledad (Post 83324)
it shows all ? marks on both links

Yes it does! whether I am logged in (bypassing WP-Super-Cache), or viewing anonymously!

But trust me, at the time I was writing the OP, the situation was exactly as I described: Russian characters via the 1st link, ??? via the 2nd link. Don't know what could happen since then...

juggledad Apr 9, 2012 09:30 AM

are the comments being entered on the blog or are they coming from facebook and being inserted via some plugin?

ymf Apr 9, 2012 10:08 AM

They are imported from Facebook (from http://goo.gl/cp0KD ) automatically via add-link-to-facebook plugin.

juggledad Apr 9, 2012 10:20 AM

There is probably a character set conversion issue going on. I just pasted that comment into a comment on my local site and it shows fine.

Take a look in teh database and see what the comment looks like there.
Also what is the character set being used in the db?

ymf Apr 10, 2012 10:56 AM

Yes, I tracked down the root cause on my end: some WP’s database tables are using the legacy (pre-WP 2.2) "CHARACTER SET latin1" instead of the new "CHARACTER SET utf8". Now I am scratching my head: how (with least efforts) to convert the database character sets from latin1 to utf8? There are too many choices...

The WP codex article "Converting Database Character Sets" is dated 2010 and describes a very manual and a very involved method;

The "UTF-8 Database Converter" plugin is dated 2010 and is no longer being maintained by the author; it uses behind the scene the SQL statements:
PHP Code:

ALTER DATABASE $db CHARACTER SET utf8
ALTER TABLE $table CONVERT TO CHARACTER SET binary
ALTER TABLE $table CONVERT TO CHARACTER SET utf8
ALTER TABLE $table MODIFY $field_type $field_options
OPTIMIZE TABLE $table 

The "Convert WP Database to UTF-8" plugin is dated 2011; it uses behind the scene the SQL statements:
PHP Code:

ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ALTER TABLE $table CHANGE $field_name $field_name $field_type CHARACTER SET utf8 COLLATE utf8_general_ci 

THen there is Alex King's blog about latin1 to utf8 conversion dated 2008...

juggledad Apr 10, 2012 01:11 PM

what ever you do, start with a database backup.

actually you could try
1) do a database export,
2) edit the export and change the language.
3) delete the database
4) import the new one.

do it to a test database first

ymf Apr 12, 2012 06:09 AM

Yes, that's exactly what I did, and it worked. It's the same as method proposed in Alex King's blog about latin1 to utf8 conversion. Thanks!


All times are GMT -6. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.