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

shorten_text doesn't work for oriental languages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 1.6.3, 1.7
    • 1.6
    • Other
    • None
    • All
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE

      Japanese and Chinese languages have no interword spaces, and text can be broken (almost) anywhere. So function shorten_text in lib/moodlelib.php must be rewritten:

      if ($stopzone) {

      if ($char == '.' or $char == ' ' or ord($char) >= 0xE0)

      { $truncate = $i; // not $i+1; break 2; }

      }

      if text is encoded in UTF-8. Note that a 0xE0-or-higher byte starts a three-byte (or longer) chacacter, which is almost always a Japanese/Chinese letter, and this hack should not affect Moodle's behavior for European languages.

            martinlanghoff Martín Langhoff
            imported Imported
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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