Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-6757

Insert a Chinese charachter string to label resource result error.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.6.3, 1.7
    • 1.6.2
    • Resource
    • None
    • Windows 2003 Server CHT version, php 5.X, MySQL 5.X
    • MySQL
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE

      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)."...";

            skodak Petr Skoda
            wcchien Chien Wen-Chang(簡文章)
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.