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

Insert a Chinese charachter string to label resource result error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3, 1.7
    • Component/s: Resource
    • Labels:
      None
    • Environment:
      Windows 2003 Server CHT version, php 5.X, MySQL 5.X
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      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

            • Assignee:
              skodak Petr Skoda
              Reporter:
              wcchien Chien Wen-Chang(簡文章)
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Oct/06