
2009/9/29 Jon A. Cruz <jon@...18...>:
For the glib world, I seem to recall that these break down: g_filename_from_uri() g_filename_to_uri()
On what cases? Why?
One of the trickiest things to deal with is converting to and from file names when those names are *not* in UTF-8. We need to remember to keep those in our testing, as all data internal to Inkscape needs to be Unicode + UTF-8.
On Linuxes the filename encoding is usually UTF-8 (e.g. anything newer than 5 years). On Windows the filename encoding is UTF-8 by definition. However, the arguments from the command line are in locale encoding (different from filename encoding), which is usually a legacy 8-bit codepage - this is the only place where the conversion is non-trivial, and the arguments of main() do not actually contain sufficient information to determine what files were actually meant - we should therefore never use the arguments of main() for *anything* on Windows.
The problem I see with keeping everything in UTF-8 is that it's a convention unsupported by Glib. Glib has functions to work with native filenames and URIs, but not with native filenames converted to UTF-8. We should just use URIs everywhere; this would add network transparency via GIO, as we wouldn't be limited to local files.
By the way, there is some code that deals with versions of Windows that do not have the wide versions of Win32 API functions (Windows 95, Windows 98 and Windows ME) - this is totally superfluous since the version of Glib we depend on does not work on such systems.
Regards, Krzysztof