Edge 42(17133) garbled since <script> default charset do not follow html charset in document.write

External Issue #16846720


Apr 10, 2018
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Edge Browser:
Microsoft Edge 42.17133.1.0
Microsoft EdgeHTML 17.17133
Windows specifications
Edition: Windows 10 Enterprise
Version: 1803
Installed on: 3/31/2018
OS build: 17133.1

Sample code to reproduce this issue

  1. Edge42Issue.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" “http://www.w3.org/TR/html4/loose.dtd">
    <!-- default charset of <script> in document.write should follow this charset setting–>
    <meta http-equiv="content-type” content="text/html; charset=UTF-8">
    <input type="hidden" id="content" value=’
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="./message.js" ></script>
    <div id ="message"></div>
    <script type="text/javascript">
    document.getElementById(“message”).innerHTML = message[“content”];
    <script language="javascript">
    var content = document.getElementById(“content”).value;
    window.onload = function() {

  2. message.js (this is utf-8 encoding)
    var message = {"content":"中文字符 means Chinese characters(multiple-byte)"};

Expected: 中文字符 means Chinese characters(multiple-byte)
Actually: 中文字符 means Chinese characters(multiple-byte)

The sample code have been attached, only found this issue in Edge 42(preview), older Edge and all other browsers do not have such issue.

BTW, this issue can work around by specific charset to script in document.write
<script type="text/javascript" src="./message.js" charset="utf-8"></script>


1 attachment

Comments and activity

  • Attachment file “Edge42Issue.html” missed the content settings, please add following code into this file then you can reproduce it.

    The pasted content in this page is correct.

  • Please use pasted content in this page, Edge42Issue.html missed in header.

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

    Changed Assigned To to “Scott L.”

    Changed Assigned To to “Travis L.”

    Changed Title from “Edge 42(17133) garbled since <script> default charset do not follow html charset in document.write” to “Edge 42(17133) garbled since <script> default charset do not follow html charset in document.write”

    Changed Status to “External”

  • This issue has been resolved External. This means this issue may require a new feature to be implemented or other work that is more significant than a typical bug. You may be able to find more information on this issue by searching for related features on status.microsoftedge.com and uservoice.microsoftedge.com.

You need to sign in to your Microsoft account to add a comment.

Sign in