NEW 184660
[GTK] Can't load local files with accented characters
https://bugs.webkit.org/show_bug.cgi?id=184660
Summary [GTK] Can't load local files with accented characters
Sebastien
Reported 2018-04-16 12:31:15 PDT
I tried to load this HTML page: ```html <html> <head> <meta charset=“utf-8”> </head> <body> <img src="file:///home/AmarOk/T%C3%A9l/t7d4.jpg"><!-- NOT OK But file exists (works on firefox)--> <img src="https://enconn.fr/T%C3%A9l/t7d4.jpg"><!-- OK --> <img src="file:///home/AmarOk/Downloads/1.png"><!-- OK and file exists--> </body> </html> ``` And tried to load it via webkit_web_view_load_html or webkit_web_view_load_uri. # Expected result 3 images should be shown # Actual result The first one with a 'é' in the path fails to load ([Error] Not allowed to load local resource: file:///home/AmarOk/T%C3%A9l/t7d4.jpg (test.html, line 8)) Didn't try on another OS
Attachments
Alexey Proskuryakov
Comment 1 2018-04-16 21:24:36 PDT
This happens because of a mismatch between decomposed and precomposed Unicode forms, and a file system that fails to respect their equivalency. Arguably not fixable from WebKit in the general case.
Sebastien
Comment 2 2018-04-26 12:47:52 PDT
It works on other web engine so why not for WebKit?
Chris Dumez
Comment 3 2018-05-02 13:10:40 PDT
(In reply to Sebastien from comment #2) > It works on other web engine so why not for WebKit? Adding some WebKit-GTK developers in CC since this bug was reported on Linux and I cannot reproduce it on MacOS.
Chris Dumez
Comment 4 2018-05-02 13:12:20 PDT
(In reply to Chris Dumez from comment #3) > (In reply to Sebastien from comment #2) > > It works on other web engine so why not for WebKit? > > Adding some WebKit-GTK developers in CC since this bug was reported on Linux > and I cannot reproduce it on MacOS. URL::fileSystemPath() for example is platform-specific and may be related to the issue here.
Michael Catanzaro
Comment 5 2018-05-02 16:10:51 PDT
Probably the same as bug #184444?
Alexey Proskuryakov
Comment 6 2018-05-03 09:20:27 PDT
> URL::fileSystemPath() for example is platform-specific and may be related to the issue here. Ah, good point. For files specifically, file system path gets normalized on Darwin. I was thinking more about the same issue in application to HTTP.
Sebastien
Comment 7 2018-12-29 13:59:57 PST
(In reply to Michael Catanzaro from comment #5) > Probably the same as bug #184444? I think it's a similar bug indeed :) I didn't have the time to dig this bug for now. And the only workaround I can do for now is to encode and inject into the page all resources but I really don't want to do that :)
Jenyay
Comment 8 2019-01-12 10:02:39 PST
Because of this bug, browsers on the WebKit2 engine (Epiphany for example) do not display images in local HTML files if the path to this file contains non-Latin characters. Also in these files JavaScript scripts do not work.
Note You need to log in before you can comment on or make changes to this bug.