LoginSignup
3

More than 5 years have passed since last update.

Microsoft Edgeで同じJSを2回読み込むと文字化けする

Posted at

Edgeでのみ発生する文字化け

index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8"/>
</head>
<body>
        <p>読み込む: <script src="write.js"></script></p>
        <p>もういちど読み込む: <script src="write.js"></script></p>
        <p>もういちど読み込む: <script src="write.js"></script></p>
</body>
</html>
write.js
document.write("水金地火木土天海");

このようなごく簡単なhtmlとjsファイル(どちらもUTF-8)を用意して同じディレクトリに置きます。

Edgeで開きます。

image.png

化けます。

化け方の確認

image.png

image.png

Windows-1252として開いたら同じような化け方が確認できます。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3