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

Insert a Chinese charachter string to label resource result error.

    XMLWordPrintable

Details

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

    Description

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

      Attachments

        Activity

          People

            skodak Petr Skoda
            wcchien Chien Wen-Chang(簡文章)
            Nobody Nobody
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Oct/06