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

html_to_text destroys UTF-8 strings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.9.11
    • 1.9.10
    • Libraries
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      html_to_text destroys UTF-8.

      Here is an example

      <?php
      require_once('config.php');
      header('Content-type: text/plain; charset=UTF-8');
      $htmlstring = "<p>Choose the correct answer for this occasion:</p><p><strong>How do you say you are sorry e.g.. at someone's misfortunes?</strong><strong></strong></p>";
      echo "Testing input to see if it is UTF-8: ", iconv("UTF-8", "UTF-8", $htmlstring);
      $textstring = html_to_text($htmlstring);
      echo "Testing output to see if it is UTF-8: ", iconv("UTF-8", "UTF-8", $textstring);

            timhunt Tim Hunt
            timhunt Tim Hunt
            Nobody Nobody (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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