I've got a webpage which dynamically embeds an iframe, which loads a JS file containing localization strings: the outer page has a content type of "Shift-JIS", but the inner frame (and the localization strings) are "utf-8". The structure is something like this:
<html>
<head>
<meta charset="shift-JIS" >
</head>
<body>
<iframe id="my-frame" src="my-frame.html">
<html>
<head>
<meta charset="utf-8" />
<script src="my-i18n.js" charset="utf-8" />
</head>
</html>
</iframe>
</body>
</html>
On initial render, the content displays correctly. But on reload, in Internet Explorer 11, if my-i18n.js
is returned from IE's cache, the utf-8 encoded content is interpreted as shift-JIS encoded content, and is visually mangled.
It's only when IE returns the localization strings from cache. If I open the devtools and click "Always refresh from server" to disable the cache, it renders fine every time.
Is there any way to fix this, or work around it?