encoding: more robust GVariant parsing

Translations cannot be trusted, so make the code more robust to parsing
errors.

Thanks to Марко М. Костић for the bug report.

https://bugzilla.redhat.com/show_bug.cgi?id=1155810
Fix Serbian translation

https://bugzilla.redhat.com/show_bug.cgi?id=1155810