Insert a Chinese charachter string to label resource result error.
For example. Insert a label, Content as [????]: ?????! ??????, ?????????????.
Error report as follow:
---------------------------------------------------------------
Data too long for column 'name' at row 1
INSERT INTO mdl_label ( COURSE, NAME, CONTENT, TIMEMODIFIED ) VALUES ( 1, '[????]: ?????! ??????..', '[????]: ?????! ??????, ?????????????. ', 1159673300 )
Could not add a new instance of label
----------------------------------------------------------------------------------------------------------------
This bug is in /moodle/mod/label/lib.php line 16:
$label->name = substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."...";
Suggest correct source as follow:
mb_internal_encoding("UTF-8");
$label->name = mb_substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."...";