I spoke too soon!

I spoke too soon!

- James Phillips の投稿
返信数: 9
Houston! I have a problem!
As people may or may not remember, on my horsefrog.com site I changed the config.php over to UTF8. Everything on the site works fine. However, when I run the cron, the automated e-mails that are sent out are full of "mojibake" if any Japanese characters are included. Any ideas on how I can fix this?
Cheers,
James Phillips
James Phillips への返信

Re: I spoke too soon!

- Timothy Takemoto の投稿
Strange....I found that UTF_8 was less likely to mojibake.

Hold on...I don't think that I changed the config.php to UTF8, merely the language setting from the GUI.

Doesn't it say something like "this is experimental"? I think that the config.php may change the way that data is stored in the database - effectively making the whole database a UTF8 database.

I think that in my systems, while the GUI and input Japanese text is stored as UTF8, the rest of the database is stored as ASCII or something else, so that when I look into the database these days, it is not so easy to see what is going on, and when I look at backup files, the Japanese text appears as mojibake inside them. But other than that, as long as I do not look directly into the database, or backup files, it seems to work okay. Not ideal though.

Try removing the setting in config.php
Timothy Takemoto への返信

Re: I spoke too soon!

- James Phillips の投稿
If I remove the UTF-8 setting in the config.php file I get problems with Internet Explorer not detecting the UTF-8 headers properly. If anybody else has any other ideas about this problem, let me know!
James Phillips への返信

Re: I spoke too soon!

- Mitsuhiro Yoshida の投稿
画像 Developers 画像 Particularly helpful Moodlers 画像 Translators
What kind of e-mail client are you using now?
When we use UTF-8, it causes mostly "mojibake" for old e-mail client.

To avoid this, I recommend you to put some php code changing characters from UTF-8 to ISO-2022-JP on /moodle/lib/moodlelib.php.



Mitsuhiro Yoshida への返信

Re: I spoke too soon!

- James Phillips の投稿
I'm using Thunderbird Ver. 1. I will try your suggestion! Thank you. 
Mitsuhiro Yoshida への返信

Re: I spoke too soon!

- James Phillips の投稿
Hmm. I am not quite sure how to do this. I cannot see any references to UTF-8 or ISO-2022-JP in the moodlelib.php file.

The relevant strings appeared to be:

    $SESSION->encoding = get_string('thischarset');

and

        $mail->Encoding = 'quoted-printable';        

Should I change these to something else?
James Phillips への返信

Re: I spoke too soon!

- Mitsuhiro Yoshida の投稿
画像 Developers 画像 Particularly helpful Moodlers 画像 Translators
OK! Please try this zipped attachement.wink