I am using GTKmm and exiv2 to read EXIF metadata form photos. However Exiv2 functions accept only std::string file paths... When I try it on not ASCII filepath it crushes the program.
Is there any way to read that data? It would be great if Exiv2 accepted Glib::ustrings...
I'm interested in solutions for Windows and Linux.
Ok, I have a solution!
You just need to use function Glibmm::locale_from_utf8 to convert UTF8 string to std(ascii) string. Here is an example:
void get_exif_data(const Glib::ustring &image_src)
{
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(Glib::locale_from_utf8(image_src));
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
Exiv2::ExifData::const_iterator it = exifData.begin();
for(it;it!=exifData.end();it++) cout << it->key() + ": " + it->getValue() << endl;
}