xdg: fix crash when non utf-8 .desktop files are found

On my box, /usr/share/applications/grip.desktop is not utf-encoded.
Note that this causes the test to fail, not sure what is the best way to make the test pass