View Revisions: Issue #440
[ All Revisions ] [ Back to Issue ]
Summary | 0000440: Fetching of file:/ URLs ignores encoding | ||
---|---|---|---|
Revision | 2013-12-23 13:57 by Vincent Sanders | ||
Description | Fetching of file:/ URLs fails to convert the path to the current system local encoding. This generates an inconsistency in the way in which local files are identified. In the case of a link in a web page, the URL will be UTF-8 encoded. In the case of a file loaded from disc (or from an URL/URI/IEURL file), the URL will be encoded in the system local encoding. When fetching the URL, the encoding is ignored (as it's assumed to be correct). If the file path contains top-bit-set characters (such as a hard-space), the UTF-8 encoded link from an HTML document will fail to fetch the file as it'll look for ...%c2%a0... instead of whatever the representation of hard-space actually is on the system at the time. To fix this requires a couple of steps: 1) Make the fetching system assume that the URL is UTF-8 encoded (which is already the case in 99% of cases) and, in the case of file:/ URLs, convert the path to the system local encoding before the fetch occurs. 2) When loading a local file (or a reference to a local file), convert the URL to UTF-8 encoding. |
||
Revision | 2006-01-11 21:35 by John-Mark Bell | ||
Description | Fetching of file:/ URLs fails to convert the path to the current system local encoding. This generates an inconsistency in the way in which local files are identified. In the case of a link in a web page, the URL will be UTF-8 encoded. In the case of a file loaded from disc (or from an URL/URI/IEURL file), the URL will be encoded in the system local encoding. When fetching the URL, the encoding is ignored (as it's assumed to be correct). If the file path contains top-bit-set characters (such as a hard-space), the UTF-8 encoded link from an HTML document will fail to fetch the file as it'll look for ...%c2%a0... instead of whatever the representation of hard-space actually is on the system at the time. To fix this requires a couple of steps: 1) Make the fetching system assume that the URL is UTF-8 encoded (which is already the case in 99% of cases) and, in the case of file:/ URLs, convert the path to the system local encoding before the fetch occurs. 2) When loading a local file (or a reference to a local file), convert the URL to UTF-8 encoding. |