MantisBT - NetSurf
View Issue Details
0000440NetSurf[All Projects] Generalpublic2006-01-11 21:352015-03-10 11:04
ReporterJohn-Mark Bell 
Assigned ToVincent Sanders 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.2 
Fixed in CI build #
Reported in CI build #
URL of problem page
Summary0000440: Fetching of file:/ URLs ignores encoding
DescriptionFetching 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.
Additional InformationImported from sourceforge bug on Tue Dec 10 17:34:12 2013

TagsNo tags attached.
Attached Files

Vincent Sanders   
2014-06-05 22:20   
Tested on RISC OS under emulation can now happily navigate to file paths with various encoded characters in them including hard spaces.
Vincent Sanders   
2015-03-10 11:04   
Confirmed fixed in 3.2 release

Issue History
2013-12-10 17:41Vincent SandersNew Issue
2013-12-10 17:41Vincent SandersStatusnew => assigned
2013-12-10 17:41Vincent SandersAssigned To => Sourceforge Import placeholder
2013-12-23 13:57Vincent SandersAssigned ToSourceforge Import placeholder =>
2013-12-23 13:57Vincent SandersStatusassigned => confirmed
2013-12-23 13:57Vincent SandersResolutionno change required => open
2013-12-23 13:57Vincent SandersDescription Updatedbug_revision_view_page.php?rev_id=725#r725
2013-12-23 13:57Vincent SandersAdditional Information Updatedbug_revision_view_page.php?rev_id=727#r727
2014-06-05 22:20Vincent SandersNote Added: 0000369
2014-06-05 22:20Vincent SandersAssigned To => Vincent Sanders
2014-06-05 22:20Vincent SandersReproducibilityhave not tried => always
2014-06-05 22:20Vincent SandersStatusconfirmed => resolved
2014-06-05 22:20Vincent SandersResolutionopen => fixed
2014-06-05 22:20Vincent SandersFixed in Version => 3.2
2015-03-10 11:04Vincent SandersNote Added: 0000706
2015-03-10 11:04Vincent SandersStatusresolved => closed