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

html2text not compatible with utf-8

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.8.10, 1.9.6
    • 1.5, 1.8.9, 1.9.5
    • General
    • None
    • Both PHP4 and PHP5
    • MOODLE_15_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      html2text function called indirectly from format_text_email function is not compatible with utf-8 charset encoding. html2text replaces all chr(160) bytes with ' ' at end of the function, while chr(160) in utf-8 encoding does not mean a white space. This causes some characters in utf-8 encoding such as 'da' (U+3060) characters in ja_utf8 garbled in text formatted email.

      — ../20050325/moodle/lib/html2text.php Sun Jan 23 11:18:50 2005

      +++ html2text.php Sat Mar 26 16:56:06 2005

      @@ -157,12 +157,12 @@

      $goodStr = wordwrap( $goodStr, 78 );

      //make sure there are no more than 3 linebreaks in a row and trim whitespace

      • $goodStr = str_replace(chr(160), ' ', $goodStr );

      +// $goodStr = str_replace(chr(160), ' ', $goodStr );

      $goodStr = preg_replace(/\r\n?/\f/, \n, $goodStr);

      $goodStr = preg_replace(/\n(\s*\n)

      {2}

      /, \n\n\n, $goodStr);

      $goodStr = preg_replace(/[ \t]+(\n/$)/, $1, $goodStr);

      $goodStr = preg_replace(/^\n*/\n*$/, '', $goodStr);

      • $goodStr = str_replace(chr(160), ' ', $goodStr );

      +// $goodStr = str_replace(chr(160), ' ', $goodStr );

      return $goodStr;

            francois Francois Marier (Inactive)
            kagotani Hiroto Kagotani
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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