Bug 127481

Summary: [GTK] webkit_web_view_load_html reads UTF8 css files as UTF16
Product: WebKit Reporter: Sami Wagiaalla <swagiaal>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, p.jacquemart
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
a small test case
none
A partial back ported patch which fixes this issue none

Sami Wagiaalla
Reported 2014-01-23 08:13:19 PST
If you use webkit_web_view_load_html and provide an HTML string which contains links to css files webkit expects those files to be UTF16. Even if the default charset was set to UTF8.
Attachments
a small test case (4.35 KB, application/x-gzip)
2014-01-23 08:14 PST, Sami Wagiaalla
no flags
A partial back ported patch which fixes this issue (3.63 KB, patch)
2014-02-03 09:50 PST, Sami Wagiaalla
no flags
Sami Wagiaalla
Comment 1 2014-01-23 08:14:47 PST
Created attachment 221983 [details] a small test case
Pascal Jacquemart
Comment 2 2014-01-24 03:50:51 PST
Hi Samy, I gave a quick try on your reduced test case but it seems to work properly for me. Launching your browser example and the text is actually displayed in blue Am I missing something?
Sami Wagiaalla
Comment 3 2014-01-24 08:47:54 PST
Hi! > I gave a quick try on your reduced test case but it seems to work properly for me. Launching your browser example and the text is actually displayed in blue Hmm.. I did not expect that. Which version of webkitgtk are you using ? Is there any reason (setting on your environment) for your webkit to read the css file correctly as UTF8 ? Just out of curiosity what happens of you replace the test.css file with test16.css file (mv test16.css test.css) ? Strangely it turns out that if you specify @charset "UTF16" in the CSS file it is read properly.
Pascal Jacquemart
Comment 4 2014-01-24 09:24:44 PST
I tried with r162697 Replacing test16.css to test.css give the same result: Big blue text Of course while removing both .css files the text is flat Maybe this issue is already fixed on the trunk?
Sami Wagiaalla
Comment 5 2014-01-24 10:06:59 PST
> Maybe this issue is already fixed on the trunk? That would be great! Let me try trunk...
Sami Wagiaalla
Comment 6 2014-01-29 07:33:23 PST
Hi Pascal, > > Maybe this issue is already fixed on the trunk? > That would be great! Let me try trunk... Looks like you were right about this. The issue was fixed in revision 160572. Specifically http://trac.webkit.org/changeset/160572/trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp Any chance of back-porting that change to a stable release ?
Carlos Garcia Campos
Comment 7 2014-01-29 08:13:07 PST
Sami Wagiaalla
Comment 8 2014-02-03 09:50:20 PST
Created attachment 222994 [details] A partial back ported patch which fixes this issue
Sami Wagiaalla
Comment 9 2014-02-03 09:50:59 PST
(In reply to comment #7) > Sure, added to the wiki https://trac.webkit.org/wiki/WebKitGTK/2.2.x Thanks Carlos. I have attached the part of the patch which fixes this issue.
Carlos Garcia Campos
Comment 10 2014-02-18 03:06:21 PST
Sami Wagiaalla
Comment 11 2014-02-19 07:15:11 PST
> Committed in http://trac.webkit.org/changeset/164280. Thanks! Sweet! Thanks Carlos!
Note You need to log in before you can comment on or make changes to this bug.