Bug 184660
Summary: | [GTK] Can't load local files with accented characters | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sebastien <amarok> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | amarok, ap, bugs-noreply, cdumez, cgarcia, jenyay.ilin, mcatanzaro |
Priority: | P2 | ||
Version: | WebKit Local Build | ||
Hardware: | PC | ||
OS: | Linux | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=184444 |
Sebastien
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
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
It works on other web engine so why not for WebKit?
Chris Dumez
(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
(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
Probably the same as bug #184444?
Alexey Proskuryakov
> 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
(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
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.