GNOME Bugzilla – Bug 688074
g_filename_from_uri doesn't work properly with Windows URIs (i.e.: file:///C:/foo.bar)
Last modified: 2012-11-11 15:36:16 UTC
g_filename_from_uri ("file:///C:/foo.bar") returns currently "/C:/foo.bar expected: "C:/foo.bar" or "C:\foo.bar" PS: I'm not setting "OS" to "Windows", because this conversion should also work in Linux.
No, g_filename_from_uri() is supposed to return an absolute pathname, and "C:/foo.bar" is not an absolute pathname on unix. Furthermore, on unix, you could potentially have a directory named "C:" at the top level of your filesystem, and in that case, "file:///C:/foo.bar" would be how you would refer to a file in that directory. glib/tests/uri.c explicitly checks that "file:///c:/foo" resolves to "c:\foo" on windows and "/c:/foo" on unix.
Fair enough, sorry for the noise. I somehow thought that ":" was an illegal character on unix, just because of the fact that it is a path separator character (in the same way the path separator character in Windows is ";" and therefore it is illegal in a path*). *Although, I just tried this in Windows2008Server, and it is legal! So I don't know where I got that idea from, maybe it was illegal in older versions of Windows? Thanks for the help anyway.