I recently upgraded to moodle 1.7 via c-panel. I selected "Japanese" and "English " language packs ,but when I go to write in Japanese say for example in assignment activity, when I save it , it then appears as "??????". Does anyone have a solution to this problem?
Cheers
Robert
Can't get Japanese to work on Moodle 1.7
返信数: 6Re: Can't get Japanese to work on Moodle 1.7
Re: Can't get Japanese to work on Moodle 1.7
Thank you for your kind reply, but where exactly do I find the "code" you linked me to ?
Robert
Robert
Re: Can't get Japanese to work on Moodle 1.7
Could you find the Moodle install directory?
Then go to "lib" directory in the Moodle install directory.
The script file you need to modify is "dmlib.php" in "lib" directory.
Open dmlib.php and go to line 1909.
And modify the "code" as below.
[Before]
switch ($CFG->dbtype) {
case 'mysql':
/// Set names if needed
if ($CFG->unicodedb) {
$db->Execute("SET NAMES 'utf8'");
}
break;
[After]
switch ($CFG->dbtype) {
case 'mysql':
/// Set names if needed
if ($CFG->unicodedb) {
// $db->Execute("SET NAMES 'utf8'");
}
break;
Then go to "lib" directory in the Moodle install directory.
The script file you need to modify is "dmlib.php" in "lib" directory.
Open dmlib.php and go to line 1909.
And modify the "code" as below.
[Before]
switch ($CFG->dbtype) {
case 'mysql':
/// Set names if needed
if ($CFG->unicodedb) {
$db->Execute("SET NAMES 'utf8'");
}
break;
[After]
switch ($CFG->dbtype) {
case 'mysql':
/// Set names if needed
if ($CFG->unicodedb) {
// $db->Execute("SET NAMES 'utf8'");
}
break;
Re: Can't get Japanese to work on Moodle 1.7
Thanks. I tried what you suggested, but it doesn't seem to make any difference. What should MySQL connection collation be set to? Does or will that make a difference?
Robert
Robert
Re: Can't get Japanese to work on Moodle 1.7
Hi,
I took another look at what I had edited and realized that I had edited the wrong part! Changed the right part and now am happy to report that I can read Japanese script.
Thanks for your assistance in this. It was greatly appreciated!
Robert
I took another look at what I had edited and realized that I had edited the wrong part! Changed the right part and now am happy to report that I can read Japanese script.
Thanks for your assistance in this. It was greatly appreciated!
Robert
Re: Can't get Japanese to work on Moodle 1.7
My Pleasure 
When we use multibyte character as Japanese, we had better set MySQL collation to 'utf8_unicode_ci' or 'utf8_general_ci'.
Please read MoodleDocs for more detail.
http://docs.moodle.org/en/Installing_Moodle

When we use multibyte character as Japanese, we had better set MySQL collation to 'utf8_unicode_ci' or 'utf8_general_ci'.
Please read MoodleDocs for more detail.
http://docs.moodle.org/en/Installing_Moodle