Use g_utf8_make_valid() in tracker-guarantee API
Some of the pictures on my hard-drive apparently have their metadata encoded in ISO8859-1 and not in UTF8: running exiv2 pr myfile.jpg
shows a �
instead of a copyright sign, while piping the output of exiv through iconv -f iso8859-1 -t utf8
does show the correct output. This leads to errors when inserting this metadata into Tracker, which (rightly) complains about incorrect UTF8 data.
If character encoding detection is too hard / not worth it (which would be my opinion), I guess we can filter all strings coming from EXIF metadata through g_utf8_make_valid
(maybe after a call to validate
to avoid unnecessary string copies ?).
Edited by Carlos Garnacho