
Loading…
the ‘Experimental features’ messed with jQuery-UI datepicker l10n #362
Is there a URL I can use to test for fixes?
it looks like i've found the cure
change
data:application/x-javascript;base64,YWxlcnQoJ+a1i+ivlScp
into
data:application/x-javascript;charset=utf-8;base64,YWxlcnQoJ+a1i+ivlScp
then the javascript is decoded correctly.
check
http://jsfiddle.net/xf8ov1jj/
(sadly the jsfiddle editor is crushed by my code)
data:application/x-javascript;charset=utf-8;
I want to investigate further, I can't do this blindly. Some data is binary, sometimes it may be a charset. I may have to revive code I had, to extract charset.
It's not only javascript being mirrored, it's not only text being mirrored. I used to use charset before in the data: URI, until I converted to an ArrayBuffer. I will just bring back that code, which read the charset from the HTTP headers, not hard-coded.
I just wanted the real life scenario you encountered to inspect the HTTP header etc. to verify that all the information I need is in there in.
It's ok, your jsfiddle here works as a test case.
Ok looking into this now.
Unfortunately, the charset is not specified in the response headers when receiving the resource through XHR. That is a problem. I suspect that normally, the browser will use the charset of the page, if one for the resource is not specified. But it looks like the browser may not be doing this for when the resource is from a data: URI. I feel like there is a browser issue here given the inconsistency.
I can't hard-code for UTF-8, because it could very well happen the resource is actually in another charset. Anyway as said above, I can't also just blindly add charset=, given that the resource may be something else than text (image/png, font/woff, etc.)
I will go with some heuristic to figure whether charset=utf-8 can be slapped for when charset is not specified. Found some documentation which I will use as the rationale for now for the chosen solution:
5 . If the "getting an encoding" steps above return failure, then set encoding to null.
6 . If encoding is null, then set encoding to utf-8.
it should look like this


and now it's like this
i think the root is base64'ed js file is not decoded using utf-8 charset.