WordPress.org

Ready to get started?Download WordPress

Forums

Unicode chinese turn into symbols after upgrade to wp2.2 (43 posts)

  1. elsewhere
    Member
    Posted 7 years ago #

    I am using unicode chinese input for my blog. It goes well with the previous version, but after i upgrade to 2.2 by Fantastico, all the chinese turn into unrecognizable texts!!!!!! How to solve this problem??????

  2. MichaelH
    Member
    Posted 7 years ago #

    If you upgraded, you should not use the DB_CHARSET and DB_COLLATE in the wp-config.php file.

    Please review Editing wp-config.php.

  3. elsewhere
    Member
    Posted 7 years ago #

    i don't quite understand. pls give more details of how i can fix the problem.

  4. MichaelH
    Member
    Posted 7 years ago #

    Please paste your wp-config.php file at http://wordpress.pastebin.ca

    Of course, take out the password value before pasting. Then report that link back here.

  5. elsewhere
    Member
    Posted 7 years ago #

    i have mistakingly delete wrdp9 when trying to restore back to the older version. so the wp-config.php file now is empty :< i try to import backup.sql back to wrdp9, is it the way to recover the wp-config.php?

  6. elsewhere
    Member
    Posted 7 years ago #

    i just want to go back to the last version....

  7. elsewhere
    Member
    Posted 7 years ago #

    i finally find the wp-config.php, and posted as you asked:

    http://wordpress.pastebin.ca/523862

  8. elsewhere
    Member
    Posted 7 years ago #

    i know what you mean and the problem is already fixed! Thxxxxx!

  9. MichaelH
    Member
    Posted 7 years ago #

    Good. Assume you deleted DB_CHARSET and DB_COLLATE from your wp-config.php file.

  10. thomasw98
    Member
    Posted 7 years ago #

    Deleting DB_CHARSET and DB_COLLATE works in that I can create Chinese language posts, but everytime I make any new posts I get the error message:

    Warning: Cannot modify header information - headers already sent by (output started at /home/webhost9/public_html/innovatize/chinese/wp-config.php:43)in /home/webhost9/public_html/innovatize/chinese/wp-includes/pluggable.php on line 329

    Other than having to look at this error message, everything else works, i.e. the Chinese language is posted without a problem.

  11. WPChina
    Member
    Posted 7 years ago #

    Yes! I'm so glad (unfortunately) that someone else had this problem!

    I had added DB_CHARSET and DB_COLLATE and then when it showed eoors, I removed and it was fine. However, there really really should be easy-to-find documentation in the install/upgrade file that explains when and how to use DB_CHARSET and DB_COLLATE. Thanks for the link here:

    http://codex.wordpress.org/Editing_wp-config.php

    but I didn't find it before and wish it could have been in an easier spot to locate (like in the distribution of the files...)

  12. MichaelH
    Member
    Posted 7 years ago #

    Can you please post your complete wp-config.php at http://wordpress.pastebin.ca/ and report that link back here.

    Thanks.

  13. thomasw98
    Member
    Posted 7 years ago #

  14. thomasw98
    Member
    Posted 7 years ago #

    <deleted by author>

  15. thomasw98
    Member
    Posted 7 years ago #

    One symptom that might point to the solution:

    I uninstalled and then reinstalled the whole WP2.2 again. During the install script process, there is a place to enter the name of the website. I entered the name in Chinese. OK, so far so good.

    When I visit the site for the first time, the Chinese website name displays correctly. But when I try to modify the name via the admin panel, it turns into ????. Any posts in Chinese also only show as ????? ??? ????, both their title and their content.

    Maybe that can give one of you experts a clue?

    Thanks!

  16. thomasw98
    Member
    Posted 7 years ago #

    Continuing to test: When I try to make a post after deleting those two lines in the config file, I can post in Chinese BUT everything I do, I get an error code as follows:

    Warning: Cannot modify header information - headers already sent by (output started at /home/webhost9/public_html/innovatize/chinese/wp-config.php:42) in /home/webhost9/public_html/innovatize/chinese/wp-includes/pluggable.php on line 329

    Even though this error code appears, the Chinese post seems to go through and it can be seen on the webpage with no problem.

  17. clappingtree
    Member
    Posted 7 years ago #

    Hi! I have the same problem.

    My wp-config.php file looks like the one that elsewhere pasted in http://wordpress.pastebin.ca/523862

    What am I supposed to do? Just remove DB_CHARSET and DB_COLLATE from my wp-config.php file? The post-deletion problems reported by the others sound scary.

  18. WPChina
    Member
    Posted 7 years ago #

    Well, I had DB_CHARSET and DB_COLLATE in my file and then had all mess code. Then I removed them and 95% of my blog when back to normal Chinese. However, some plugins like wp-email were corrupted and now show ????? for all Chinese characters. I need to now re-translate that and some smaller things.

    Not a big nightmare for me, but definitely quite a hassle and loss of time and energy :(

  19. clblog
    Member
    Posted 7 years ago #

    Same here, i have big problem now! I did a upgrade to 2.2 by Fantastico last night, and all the Chinese turn into ????. However i read from other's blog, knowing that i need to change all the database's collation to utf8_general_c. I did that too, but it was not working. I found some says need to edit wp-config.php file, so i did and it was even worse.

    I managed to return back to 2.1.3, and it was a mess. The support from my Host suggested me to remove wordpress and reinstall again. I did removed the 2.1.3 but not able to install the wordpress 2.2 as i can't install two wordpress in the same domain. (funny! I did removed the old installation right? and there is no wordpress installed in my Fantastico).

    Anyway when i assess my blog, the page was blank and asked me to do the installation. So i follow the steps and manage to install the 2.1.3. back. Now, the Chinese text still unreadable and many other errors too. I can't use the 'manage' tool now, and i have two error messages:

    Fatal error: Call to undefined function get_private_posts_cap_sql() in /home/clblogne/public_html/wp-admin/index.php on line 64

    Fatal error: Call to undefined function _get_category_hierarchy() in /home/clblogne/public_html/wp-admin/admin-functions.php on line 771

    Sorry for the long story, but can someone help? I really don't know what to do now!

  20. thomasw98
    Member
    Posted 7 years ago #

    I think I figured it out now. Here's what I did:

    1. Installed fresh version of WP2.2

    2. Checked database via phpMyAdmin which I can access via my cpanel (server control software; most people using a virtual server has the same setup I think)

    2a. Here I was a bit confused by all the advice flying around in this forum about changing the database character set or something like that. Now I see where I was confused. At the top level of phpMyAdmin, on the first screen that appears, I checked to be sure the settings for LOCALHOST were:

    MySQL charset: UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_unicode_ci

    Here's where it is a bit confusing...if I opened the actual database for this Chinese blog (I am running several different databases within the same master database), it shows the collation as latin_swedish_ci. It lists this for each separate part of the database such as categories, posts, comments, etc. I did NOT bother changing this at all, as it has no effect, at least on this situation.

    I then exited from phpMyAdmin.

    3. I then edited the standard wp-config.php file as the moderator mentioned above. I removed the two lines:

    define('DB_CHARSET', 'utf8');

    define('DB_COLLATE', '');

    4. Check the end of the wp-config.php file now. You should see a ?> and there should be NOTHING after it...no blank lines or even one single blank space! As it turns out, this was the cause of the problem I described above where I was constantly getting an error of "Warning: Cannot modify header information - headers already sent by (output started at /home/...". I don't know how the extra blank line and blank space got added to my wp-config.php file. It seems that my html editor added this when I opened the file to delete the two lines. Or maybe it has something to do with the way I downloaded the file. I am not sure, but anyways, make sure you do not have this problem on your file before you save it and then upload it.

    5. I then uploaded the modified wp-config.php file and everything worked perfectly, i.e. Chinese characters displayed correctly and no strange error message appeared.

    6. So far it seems like everything works fine. I have not found any problems or conflicts yet.

    7. One final point: I tried all the other methods mentioned in this forum to solve the Chinese ???? problem and NONE of them worked except this one.

    Hope that helps everyone! 加油!

    Thomas

  21. MichaelH
    Member
    Posted 7 years ago #

    Thanks for the information Thomas. In 2a, you said you

    ...I checked to be sure the settings for LOCALHOST were:

    MySQL charset: UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_unicode_ci

    Did you change to those values or were they already set that way?

  22. thomasw98
    Member
    Posted 7 years ago #

    Those were the existing settings so it seems that those are the default settings for my server's MySQL databases.

  23. alwayslearning
    Member
    Posted 7 years ago #

    Thank you Thomas for sharing the solution. It works!

    Best regards,

    "What Can't Kill You, Will Make You Stronger"

  24. towfigh
    Member
    Posted 7 years ago #

    Hmm, that's all very interesting but unfortunately doesn't work for me.
    Here's what happened with my wordpress install:

    I upgraded to 2.2, leaving the config file untouched. Now when I look at posts that contain Chinese characters, they randomly display as "ä??" in FireFox or as "ä" and two square bullets with a question mark in Safari. When I edit the post, however, everything is displayed totally correct? For an example, check http://www.towfigh.net/emanuel/categories/hanyue

    Any idea for a remedy?

    Thanks in advance...

  25. towfigh
    Member
    Posted 7 years ago #

    Found the solution, in case anyone else has similar problems: The plugin "o42-clean-umlauts" in its current 0.2.0 version is incompatible with WP2.2

    Cheers

  26. carrasco
    Member
    Posted 7 years ago #

    I was having a similar problem with Japanese and I followed Thomas's suggestion and that worked (thank you). But I am wondering if by removing the following lines if that has caused problems with the RSS feed because the xmlrpc.php file goes to the wp-config.php to find the charset which has now been removed.

    define('DB_CHARSET', 'utf8');

    define('DB_COLLATE', '');

    When I go to validate my feed I get the following error:

    XML Parsing Error: syntax error
    Location: http://www.mdcarrasco.com/blog/feed
    Line Number 1, Column 31:<?xml version="1.0" encoding=""?>

    I think it has to do with the encoding which is why I am posting in here. I was wondering if anyone else was having this problem or if you perhaps knew of a solution?

    Thank you for the great information.

  27. szeping
    Member
    Posted 7 years ago #

    Thanks thomasw98! It really works...

    In fact, I just started blogging with WordPress 2.2 few days ago and I found the problem. I thought it should be my problem only since I can see many chinese blogs around using WP as well. Who knows, it's 2.2 version's fault.

    But, as carrasco mentioned, will it affect RSS?

  28. sheffner
    Member
    Posted 7 years ago #

    Thanks, thomasw98. I was having same trouble with Japanese script not showing up properly. However, trying thomasw98's suggestions did not solve the problem for me.

    The config.php file says

    "// Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', ''); "

    I don't have a folder <languages> in <wp-content>. Should I have?
    Also, I'm using cPanel's File Manager. How do I install an "mo" file? Where do I get it from? Do I need the Japanese MO file? Where do I get it from?

  29. moshu
    Member
    Posted 7 years ago #

    No and no and no...
    1. Your blog is in English - you don't need any .mo file.
    2. Don't copy paste from Japanese source that is NOT utf-8 encoded. Type (if you can) your Japanese words/text as you do with the Englsih and it should show up correctly.
    3. thomasw98 was NOT referring to the portion of the wp-config that you quoted above!
    4. If you did an automatic upgrade to Wp 2.2 - then you have to delete the two lines from the wp-config:

    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');
  30. sfong15
    Member
    Posted 7 years ago #

    What thomasw98 said earlier here is what happening to me. My host said default charset of latin_swedish_ci can't be changed and if I want to alter collation I have to get into each and every table and change it manually. I did that for one of my sites, too troublesome. Alternative solution would be exporting your db, create new db (with the charset and collation you want at top level) and import again. That's also scary and risky and your site will be down for a while.

    I just wondered if there are geeks for MySQL around who may know a way to alter collation for all tables in a database, say by running a script file or something like that.

    If that's possible perhaps a plugin for non-English users of WP would welcome that.

Topic Closed

This topic has been closed to new replies.

About this Topic