The question Convert absolute filesystem path to a file URI in a platform-agnostic way
is six years old and now we have boost url https://www.boost.org/doc/libs/1_85_0/libs/url/doc/html/index.html.
Is it possible to convert the abs path with boost url?
I tried for example this:
boost::url u;
u.set_scheme( "file" );
u.set_path( "c:/path/to/file.txt" );
cout << u << "n";
The result is:
file:c:/path/to/file.txt
But it should be:
file:///c%3A%2Fpath%2Fto%2Ffile.txt
You can test it with https://www.urlencoder.org/
Thanks,
Thomas