WordPress.org

Ready to get started?Download WordPress

Forums

Confirmation on japanese fonts issue (13 posts)

  1. Shuugo
    Member
    Posted 4 years ago #

    Hey guys.

    Well, as many users have before, I'm currently facing issues with WordPress and japanese characters. Whatever I type gets converted into question marks when I submit the post.

    User Claire said this in a post I've found when searching for solutions:

    I can't remember where I found it now, but I had to remove these lines from the config file.

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    The problem was due to Fantastico.

    I did indeed use Fantastico to install WP. So, can I really go on and do this procedure? Will this really solve the issue?

    Also, where is this config file?

    Thanks a lot in advance for anyone who answers =)

  2. Shuugo
    Member
    Posted 4 years ago #

    Wah, still no answers, can anyone please help me =(?

  3. Shuugo
    Member
    Posted 4 years ago #

    Ermm...okay, I've tried what Claire said and it didn't work. It only messed up my Portuguese accents.

    Can anyone PLEASE lend me a hand on this one? I have absolutely no clue on how to solve this.

    Thanks again for anyone who reads / replies to this.

  4. e-sushi
    Member
    Posted 4 years ago #

    Heya... just a quick idea, but I've had similar issues with other languages producing the same ignorant question marks.

    Make sure your theme is UTF-8 too! At least the "header.php" should be saved as a "utf-8" file. You can do that easy on a PC with notepad or something alike.

    Check that theme! For me, saving all theme files as utf-8 works wonders when ot comes to special characters like "äüößéè" and especially "電子寿司". ;)

  5. e-sushi
    Member
    Posted 4 years ago #

    Btw.: the config file you are looking for is called "wp-config.php" and should be located in your website base directory (the root).

  6. Shuugo
    Member
    Posted 4 years ago #

    I've tried changing my header.php to an unicode file, and unfortunately it didn't work. It made all the letters become capital letters and it kinda of broke the layout.

    I'm using the Lightwords theme btw, don't know if that helps anyone helping me =(

    Thanks for your input, e-sushi =), if you have anything else you think it's worth trying, please do tell me.

  7. graemethom
    Member
    Posted 3 years ago #

    Shuugo,

    I just tried the following series of simple steps which seemed to work.

    Conclusion: The key point of this exercise is to manually change the encoding to ISO-8859-1 within WordPress (don't forget to Save Changes), insert the desired Japanese text in a post/page and have the software automatically convert the Japanese characters into their underlying hex code (6 characters) when you publish/update the post/page, and then manually change the encoding back to UTF-8 (and Save Changes).

    Procedure:

    1. From the admin page, go to "Settings" - "Reading"
    2. At the bottom of the page in the box next to where it says "Encoding for pages and feeds" enter ISO-8859-1 (with hyphens, no spaces) - you are effectively replacing the default value in this box which usually appears as UTF-8.
    3. Click the "Save Changes" button.
    4. Go and create a new post or page (or edit an existing one) and from the HTML tab (as opposed to the Visual tab) insert the desired Japanese text (hiragana, katakana, kanji, or other double-byte characters) where it should go - the actual Japanese characters should appear as normal at this stage. DO NOT PUBLISH OR UPDATE the post/page yet!
    5. Just as a precaution, be sure to first select all the text in the post/page and copy it to clipboard memory (or for extra insurance dump the text into a separate text or other file) - this is just in case you lose all other content following the Japanese text after you publish/update and provides a means of recovering the content quickly and painlessly.
    6. Publish or Update the post/page (assuming you have the text already copied elsewhere as a backup), and once the publish/update process has finished you should be able to see a string of alphanumeric characters where all the native Japanese characters have been automatically converted into code (I think it is hex = 6 characters of code for each Japanese character).
    7. If you lost all the text following where the Japanese characters should have been, recover it from your backup source and start again.
    8. Assuming all the text is still there (with the Japanese text having been correctly converted into hex code), then view the actual post/page in your browser to confirm that the native Japanese characters appear as they should.
    9. Go back to "Settings" - "Reading" on the admin page and change the encoding back to UTF-8 and don't forget to "Save Changes" again.

    That is it.

    So there should be no need for you to create extra text files and save them as UTF-8 or Unicode outside of WordPress, and you shouldn't have to play around with your theme's header or config files either.

    Hope this helps.

    Kind regards,
    Graeme Thom

  8. graemethom
    Member
    Posted 3 years ago #

    Here is a list of the 1,945 "joyo kanji" (common use) with the code for each (note that the final semicolon is part of the code). You should be able to search for a particular kanji within this post (joyo kanji only) and look up its code. I will follow up with kanji lists for the "kyoiku" (education), "jinmei" (people's names), and "toyo" (previous list of common use kanji which was overhauled in 1981) categories in due course.














    退 退

























    稿 稿




































































    調 調














  9. graemethom
    Member
    Posted 3 years ago #

    Woops - kind of messed up the previous posts. The individual kanji codes appeared as the kanji instead of the codes (despite using backticks).

    Anyway, I have created a Google Docs spreadsheet which contains all the codes for Joyo, Kyoikuyo, Jinmeiyo, and Toyo kanji lists.

    https://spreadsheets.google.com/ccc?key=0AmkyCH91Fcm7dFlRb0drdm1ySFdFZGhxLVQ0US1vNkE&hl=en

    Graeme

  10. louiserouse
    Member
    Posted 3 years ago #

    Graeme, do you read/write Japanese?
    This is an incredibly impractical solution. Writing kanji is not like adding the very occasional ü character into several pages of text - it's the whole several pages.
    Suggesting the solution to WordPress's Japanese ??? bug is for them to type out the code for every single character is the same as asking an English-writing user to write out every page of their website by typing a six digit code per letter.
    It must have taken you a long time to write out all the codes for 2000 odd kanji into a spreadsheet, unfortunately for the majority of people with this problem I think it will be totally useless.

    somebody please contribute if you know how to write in Japanese in a standard English wordpress installation without it turning to ??? when you press publish.

  11. Bonecrusher
    Member
    Posted 3 years ago #

    The problem may be your browser settings and not the homepage at all.
    Have you asked other people (in Japan) if they see question marks or kanji characters?

  12. louiserouse
    Member
    Posted 3 years ago #

    I am in Japan. This problem is not a browser problem.
    This is a wordpress problem.

    update
    I tried commenting out the

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');

    in the wp-config file as suggested by user "whooami"on this thread
    http://wordpress.org/support/topic/wordpress-284-disaster?replies=5
    and now the posts inside the loop display properly. However a plugin in the sidebar for switching between languages which had hitherto displayed a "日本語" label correctly now displays ???.
    The posts were more important and I might be able to work around the sidebar issue but this is all so messy.
    I, like user "kmlawson" on the above thread don't know why the character set definition in the config file should break instead of enable 2-byte text.

  13. graemethom
    Member
    Posted 3 years ago #

    Dear Louise,

    Thank you sincerely for your comments. Very passive aggressive indeed. Love it ...

    L: Graeme, do you read/write Japanese?
    G: Yes, as a matter of fact I do.

    L: This is an incredibly impractical solution.
    G: Really? Thanks for the tip. I actually found it quite practical and very time efficient. It did just the trick for what I needed it to do. Sorry it may not have worked for you.

    L: Writing kanji is not like adding the very occasional ü character into several pages of text - it's the whole several pages.
    G: Well I only actually needed it for three specific kanji. Perhaps I should have given more explanation about how I used the solution from the outset. Apologies if I misled you to thinking the method was suitable for writing lengthy prose. In fact, you might be able to use the same method if you typed the Japanese in a separate text editor external to the blog, and then copied and pasted it into a post along the lines of the steps I outlined. Could be worth a try in the absence of any other workarounds. Oh, and I mean type the Japanese using a normal IME (input method editor) - not the 6-digit code for each character (ha ha - more below).

    L: Suggesting the solution to WordPress's Japanese ??? bug is for them to type out the code for every single character is the same as asking an English-writing user to write out every page of their website by typing a six digit code per letter.
    G: Sorry - can't remember suggesting or recommending that to anyone. Reread the steps. By the way, did you even actually try the steps?

    L: It must have taken you a long time to write out all the codes for 2000 odd kanji into a spreadsheet, unfortunately for the majority of people with this problem I think it will be totally useless.
    G: Actually, it did take me a very long time (note the occasional use of bold text for effect), and for no thanks whatsoever (boo hoo). I think I clocked the total time taken at less than five minutes all up. And, you know what, you can't please everyone now, can you? However, if my suggestion helps even just one person, I would be happy to have invested that 5 minutes to make the world a better place - even just a little bit better. Even if it doesn't help anyone, so be it. Take it or leave it. That's life. And, do you really think I was born yesterday? I mean, do you honestly think I sat down and typed in each of those 2,000 odd kanji, and then the corresponding 6-digit code for each one for the sake of hopefully pleasing the ungrateful masses? Come on, give me a break! Have you ever heard of "copy and paste" and "let the software do it for you" - perhaps you should reread the steps I outlined. Maybe the pin will drop. Whatever ....

    L: somebody please contribute if you know how to write in Japanese in a standard English wordpress installation without it turning to ??? when you press publish.
    G: I really do wish you good luck with that! With such attitude, I am sure all the wonderful and helpful WordPress users and coders will come running to beat down your door to help you.

    Life is short - enjoy !!!

    Oyasumi

Topic Closed

This topic has been closed to new replies.

About this Topic