News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Posting anything in Chinese results in a question mark for each character typed

Started by ssnickerer, May 01, 2007, 10:36:56 PM

Previous topic - Next topic

metallica48423

you should be able to open your database and click 'sql', and paste it, and run the query.

do a backup first though.

Keep in mind, if your tables don't start with smf_, you'll need to edit the query with the right table prefix.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

ssnickerer

Okay, thanks! So the 'code' Phalloidium posted is a query? I was just confused, because he said that writing a query seemed impossible.

Quote from: Phalloidium on October 09, 2007, 06:36:42 AM
I tried for about 2 hours to write a query that would convert all the tables in the database, but that proved impossible. So here is a series of statements that will convert all the columns in all the tables in a default install of SMF 1.1.x

metallica48423

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

MrPhil

Quote from: ssnickerer on October 09, 2007, 02:41:52 PM
Okay, thanks! So the 'code' Phalloidium posted is a query? I was just confused, because he said that writing a query seemed impossible.

It's a whole bunch of individual queries. It sounds like what he meant was that he tried to come up with one query that would modify the entire database, but couldn't do it. What he gave was a query to apply against every table individually.

By the way, view the source of the SMF page being displayed with corrupted Chinese characters, and make sure its character set is UTF-8 and not Latin-1 (iso-8859-1). If that's wrong, there would be a language setting somewhere in SMF to change. Once you have changed each table over to UTF-8, be sure to run phpMyAdmin to browse a few tables and make sure the data is correct in the database. If the data was corrupted going in to the database, no amount of changing stuff in the table definitions is going to help you.

ssnickerer


metallica48423

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Something like that

Quote from: MrPhil on October 09, 2007, 05:42:27 PM
Quote from: ssnickerer on October 09, 2007, 02:41:52 PM
Okay, thanks! So the 'code' Phalloidium posted is a query? I was just confused, because he said that writing a query seemed impossible.

It's a whole bunch of individual queries. It sounds like what he meant was that he tried to come up with one query that would modify the entire database, but couldn't do it. What he gave was a query to apply against every table individually.

Yeah, the idea was to list all the tables in the database, then perform the conversion on each one. Unfortunately, that proved impossible with just SQL. That would allow for tables named whatever, and new tables from modifications, etc.

bassbass

Quote from: Phalloidium on October 09, 2007, 06:36:42 AM
I tried for about 2 hours to write a query that would convert all the tables in the database, but that proved impossible. So here is a series of statements that will convert all the columns in all the tables in a default install of SMF 1.1.x

ALTER TABLE smf_attachments CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_ban_groups CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_ban_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_board_permissions CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_boards CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_calendar CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_calendar_holidays CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_categories CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_collapsed_categories CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_actions CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_activity CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_banned CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_boards CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_errors CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_floodcontrol CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_karma CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_mark_read CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_notify CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_online CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_polls CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_search_messages CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_search_results CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_search_subjects CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_search_topics CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_log_topics CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_membergroups CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_members CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_message_icons CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_messages CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_moderators CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_package_servers CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_permissions CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_personal_messages CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_pm_recipients CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_poll_choices CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_polls CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_sessions CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_settings CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_smileys CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_themes CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE smf_topics CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;


Enjoy!

Thanks, this worked for me too.  great job writing the query...


ekfaysal

anybody?
please
i think i done something wrong with database
PLease tell me how to remove this

metallica48423

ekfaysal: this topic is marked solved, as such, most of the support team will not view it at this point.  PLEASE create a new topic for your issue.  Thanks!
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: