gcontenttype: Make filename valid utf-8 string before processing
The g_content_type_guess_for_tree
function segfaults currently when
processing filenames that are not valid UTF-8 strings. Let's use the
g_utf8_make_valid
function before other processing to prevent that.
Fixes: #3168 (closed)