While RFC 3986 does not specify how to handle drive letters, the majority of implementations include the drive letter (e.g. C:\ , D:, ...) on Windows, and so omitting it does not really match up with real-world behavior or applications. Newer RFCs/standards also use this behavior, e.g. RFC 8089 , WhatWG .
Without it, it is impossible to use solely Uri.path to return a path on the non-current drive.
Examples:
Printf.printf "%s \n" (Uri.pct_decode(Uri.path(Uri.of_string("C:\\Program Files (x86)\\"))))
Printf.printf "%s \n" (Uri.pct_decode(Uri.path(Uri.of_string("D:\\Program Files (x86)\\"))))
Both return:
which only gives a path on the current drive, while, I feel, a more appropriate result would be:
Inconsistently, in these basic examples, using Uri.to_string (instead of Uri.path) will return with the drive letter.
While RFC 3986 does not specify how to handle drive letters, the majority of implementations include the drive letter (e.g. C:\ , D:, ...) on Windows, and so omitting it does not really match up with real-world behavior or applications. Newer RFCs/standards also use this behavior, e.g. RFC 8089 , WhatWG .
Without it, it is impossible to use solely Uri.path to return a path on the non-current drive.
Examples:
Both return:
which only gives a path on the current drive, while, I feel, a more appropriate result would be:
Inconsistently, in these basic examples, using Uri.to_string (instead of Uri.path) will return with the drive letter.