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

The email bodies which are written by HTML editor sent by forum_cron() is broken in Multibyte character set environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • 1.9.6, 2.0
    • 1.9.5, 2.0
    • Language, Libraries
    • None
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • Easy

      The cause of this problem is utf8_encode() function in lib/html2text.php.(since 12th/Jun/2009)

      function _convert()
      {
      // Variables used for building the link list
      $this->_link_count = 0;
      $this->_link_list = '';

      $text = trim(stripslashes($this->html));

      // Convert <PRE>
      $this->_convert_pre($text);

      // Run our defined search-and-replace
      $text = preg_replace($this->search, $this->replace, $text);
      $text = preg_replace_callback($this->callback_search, array(&$this, '_preg_callback'), $text);

      // Replace known html entities
      // $text = utf8_encode(html_entity_decode($text)); // Here!!!
      $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');

      // Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
      $text = preg_replace('/&[^&;]+;/i', '', $text);

      utf8_encode() function converts characters from ISO-8859-1 to UTF-8.
      Then, Multibyte UTF-8 characters were convereted to wrong unexpected characters...

            francois Francois Marier (Inactive)
            shirai Tatsuya Shirai
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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