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

XHTML export format (tablelib.php) should add a utf-8 meta tag.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Language, Other
    • Labels:
    • Testing Instructions:
      Hide

      1. Go to a report, e.g. a quiz report with some attempts.

      2. Download it in XHTML format.

      3. Make sure the downloaded file contains a meta tag saying that it is UTF-8.

      Show
      1. Go to a report, e.g. a quiz report with some attempts. 2. Download it in XHTML format. 3. Make sure the downloaded file contains a meta tag saying that it is UTF-8.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Exporting table contents in XHTML format does create XHTML files with the correct encoding and <xml> header, but browsers don't display the utf-8 encoding correctly unless the following meta-tag is provided.
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

      I could track this down to the
      class table_xhtml_export_format

      and the
      function start_document($filename) {

      I suppose this function should also add the meta-tag.
      If I add it manually in the HTML file, it works.

      Steps to reproduce:

      • Download the statistics report of a mod_quiz as XHTML format.

      Tested with Firefox 21.0 (Ubuntu 13.04 and Windows 7)
      Moodle 2.5+ (Build: 20130606)

      PS: Being already at it I gave the HTML to the W3C validator and it also found that you have one </tbody></table></div> too much at the end. So maybe this could be fixed as well.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            jzimmer Juergen Zimmer
            Integrator:
            Dan Poltawski
            Tester:
            Mark Nelson
            Participants:
            Component watchers:
            David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Sep/13