-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE9 encoding issue #5
Comments
I have had some success integrating the approach used in https://github.com/mathiasbynens/jsesc, with modifications to always use |
Thanks for the report, @Cody-SDLGov! @mathiasbynens maintains a somewhat related project named "he" that I think would be more appropriate here. If I understand the problem correctly, though, we'll need a new feature. I've submitted a draft implementation for review; let's see how that goes and decide next steps after that. |
(Also, you can see my reduced test case on the |
The he@0.5.0 release includes @jugglinmike’s patch! 👍 |
The following HTML code demonstrates a problem with IE9:
I expect to see the Arabic character "ف", but instead see mangled text output.
I can inject an alert into polyfill that shows the content it receives is proper UTF-8.
I am serving this from a basic nginx on linux.
The problem does not show up when browsing with Chrome/FF/IE10.
(I forced polyfill to use the 'legacy' path for those to be sure).
The same issue can be seen with what is effectively the result of this:
document.getElementById("testFrame").src = "javascript:{String.fromCharCode(1601);};";
For IE9, this produces the mangled text. For IE10, it is fine.
The UTF-8 bytes in the content present when I use "view source" on the iFrame appear to be 0x0041 0x0006 in Hex, which in fact is the reverse (and padded) value of the actual desired UTF8 of 0x06 0x41.
I can also inject HTML escaped items in Hex, ie: ف. This works for IE9. But using the actual UTF-8 byte sequence, which is the case in many input files, does not. Therefore, a general solution may need to escape all multibyte input characters.
The text was updated successfully, but these errors were encountered: