-
Bug
-
Resolution: Fixed
-
Minor
-
2.1, 2.1.1, 2.4
-
In Chinese environment.
-
Any
-
MOODLE_21_STABLE, MOODLE_24_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
-
w49_
MDL-29442_m25_entityutf8 -
If you visit other course from navigation menu, apache's error_log file will record something like "json_encode(): Invalid UTF-8 sequence in argument". It seems json_encode() function received none utf8 character. Navigation menu can't work sometimes. I found some problematic code in lib/navigationlib.php line 4000:
lib/navigationlib.php line 4000 |
if ($child->forcetitle || $child->title !== $child->text) {
|
$attributes['title'] = htmlentities($child->title);
|
}
|
htmlentities use ISO-8859-1 character set as default, but my course title has Chinese character, after called htmlentities, these Chinese character will not be recognizable any more. I think the code should be changed like this:
if ($child->forcetitle || $child->title !== $child->text) {
|
$attributes['title'] = htmlentities($child->title,null,'UTF-8');
|
}
|
I found moodle called htmlentities in many places, if these callings use ISO-8859-1 as default charset, the Asia user of moodle will suffer inconvenience. I hope all these callings will be checked carefully.
- is duplicated by
-
MDL-36867 Chinese characters in course name preventing display of topics in Navigation block
-
- Closed
-