[Webkit-unassigned] [Bug 137756] WKWebView: JavaScript fails to load, apparently due to decoding error

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 20 09:01:13 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137756

Morten Heiberg <morten at strangeloop.dk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |morten at strangeloop.dk

--- Comment #10 from Morten Heiberg <morten at strangeloop.dk> ---
It looks like the apostrophe that Alexey spotted in the large script is exactly the reason why this happens.

I am attaching a small iOS project which reliably reproduces this issue. 

The large script from Nolan's original index.html has been removed and replaced with a single string variable containing the U+2019 "smart quote" apostrophe, reducing the test case to 16 lines.

The ViewController.m file instantiates a WKWebView and a LOAD_THROUGH_STRING macro toggles loading the HTML either through WKWebView's loadHTMLString:baseURL: or loadRequest: method.

The UTF-16 JS encoding issue is seen when using loadHTMLString:baseURL: but not when using loadRequest:

Currently it seems that the only two workarounds for this are

1: Embed a web server in the application and serve local assets over HTTP, controlling the encoding using HTTP headers.
2: Write all dynamically generated HTML strings to the file system (which might not even work long term if I read Alexey's comment correctly).

Neither seems like a good solution. In light of this I would like to ask for the "INVALID" resolution to be reconsidered.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141020/f0f2d6cc/attachment-0002.html>


More information about the webkit-unassigned mailing list