Fix crash on filename conversion error

Authored by aheinecke on May 14 2017, 2:39 PM.


Fix crash on filename conversion error

* src/fileman.c (add_file): Handle conversion errors.

If g_filename_to_utf8 fails we now fall back to g_locale_to_utf8.
If this still does not work we fall back to g_filename_display_name
which replaces unconvertibale strings by question marks or unicode
Previously NULL pointer would be inserted as filenames, leading
to crashes later on.

This is especially important for windows where D&D files came
in System encoding as well as "Double clicked" or "Open With" files.
On windows filename_to_utf8 always assumes that the input is already
UTF-8, because it's stupid. (or because the GTK File Dialog returns
UTF-8 filenames) so the fallback to locale is especially important