[Digikam-devel] [Bug 132244] Special Chars in Keywords decode wrong in IPTC

Gilles Caulier caulier.gilles at free.fr
Wed Oct 4 09:12:48 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=132244         




------- Additional Comments From caulier.gilles free fr  2006-10-04 10:12 -------
SVN commit 592268 by cgilles:

digikam from trunk : strings from Exiv2 to render metadata content are ascii, not local 8 bits formated. If we use a linux dist using UTF8 encoding (like Suse 10.1 for ex.), some characters can be wrongly decoded.

CCBUGS: 132244

 M  +7 -7      exifwidget.cpp  
 M  +7 -7      gpswidget.cpp  
 M  +7 -7      iptcwidget.cpp  
 M  +7 -7      makernotewidget.cpp  


--- trunk/extragear/graphics/digikam/libs/widgets/metadata/exifwidget.cpp #592267:592268
 @ -149,7 +149,7  @
 
         for (Exiv2::ExifData::iterator md = exifData.begin(); md != exifData.end(); ++md)
         {
-            QString key = QString::fromLocal8Bit(md->key().c_str());
+            QString key = QString::fromAscii(md->key().c_str());
 
             // Decode the tag value with a user friendly output.
             QString tagValue;
 @ -161,7 +161,7  @
             {
                 std::ostringstream os;
                 os << *md;
-                tagValue = QString::fromLocal8Bit(os.str().c_str());
+                tagValue = QString::fromAscii(os.str().c_str());
             }
             tagValue.replace("\n", " ");
 
 @ -178,7 +178,7  @
     catch (Exiv2::Error& e)
     {
         kdDebug() << "Cannot parse EXIF metadata using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return false;
     }
 @ -203,12 +203,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag title using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("Unknow");
     }
 @ -220,12 +220,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag description using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("No description available");
     }
--- trunk/extragear/graphics/digikam/libs/widgets/metadata/gpswidget.cpp #592267:592268
 @ -275,12 +275,12  @
 
         for (Exiv2::ExifData::iterator md = exifData.begin(); md != exifData.end(); ++md)
         {
-            QString key = QString::fromLocal8Bit(md->key().c_str());
+            QString key = QString::fromAscii(md->key().c_str());
 
             // Decode the tag value with a user friendly output.
             std::ostringstream os;
             os << *md;
-            QString tagValue = QString::fromLocal8Bit(os.str().c_str());
+            QString tagValue = QString::fromAscii(os.str().c_str());
             
             // We apply a filter to get only standard Exif tags, not maker notes.
             if (d->keysFilter.contains(key.section(".", 1, 1)))
 @ -309,7 +309,7  @
         d->detailsButton->setEnabled(false);
         d->detailsCombo->setEnabled(false);
         kdDebug() << "Cannot parse EXIF metadata using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return false;
     }
 @ -334,12 +334,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag title using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("Unknow");
     }
 @ -351,12 +351,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {   
         kdDebug() << "Cannot get metadata tag description using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("No description available");
     }
--- trunk/extragear/graphics/digikam/libs/widgets/metadata/iptcwidget.cpp #592267:592268
 @ -126,12 +126,12  @
 
         for (Exiv2::IptcData::iterator md = iptcData.begin(); md != iptcData.end(); ++md)
         {
-            QString key = QString::fromLocal8Bit(md->key().c_str());
+            QString key = QString::fromAscii(md->key().c_str());
             
             // Decode the tag value with a user friendly output.
             std::ostringstream os;
             os << *md;
-            QString value = QString::fromLocal8Bit(os.str().c_str());
+            QString value = QString::fromAscii(os.str().c_str());
             // To make a string just on one line.
             value.replace("\n", " ");
 
 @ -157,7 +157,7  @
     catch (Exiv2::Error& e)
     {
         kdDebug() << "Cannot parse IPTC metadata using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return false;
     }
 @ -181,12 +181,12  @
     {
         std::string iptckey(key.ascii());
         Exiv2::IptcKey ik(iptckey); 
-        return QString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetTitle(ik.tag(), ik.record()) );
+        return QString::fromAscii( Exiv2::IptcDataSets::dataSetTitle(ik.tag(), ik.record()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag title using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("Unknow");
     }
 @ -198,12 +198,12  @
     {
         std::string iptckey(key.ascii());
         Exiv2::IptcKey ik(iptckey); 
-        return QString::fromLocal8Bit( Exiv2::IptcDataSets::dataSetDesc(ik.tag(), ik.record()) );
+        return QString::fromAscii( Exiv2::IptcDataSets::dataSetDesc(ik.tag(), ik.record()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag description using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("No description available");
     }
--- trunk/extragear/graphics/digikam/libs/widgets/metadata/makernotewidget.cpp #592267:592268
 @ -175,12 +175,12  @
 
         for (Exiv2::ExifData::iterator md = exifData.begin(); md != exifData.end(); ++md)
         {
-            QString key = QString::fromLocal8Bit(md->key().c_str());
+            QString key = QString::fromAscii(md->key().c_str());
             
             // Decode the tag value with a user friendly output.
             std::ostringstream os;
             os << *md;
-            QString value = QString::fromLocal8Bit(os.str().c_str());
+            QString value = QString::fromAscii(os.str().c_str());
             value.replace("\n", " ");
 
             // We apply a filter to get only standard Exif tags, not maker notes.
 @ -196,7 +196,7  @
     catch (Exiv2::Error& e)
     {
         kdDebug() << "Cannot parse MAKERNOTE metadata using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return false;
     }
 @ -220,12 +220,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag title using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("Unknow");
     }
 @ -237,12 +237,12  @
     {
         std::string exifkey(key.ascii());
         Exiv2::ExifKey ek(exifkey); 
-        return QString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
+        return QString::fromAscii( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
     }
     catch (Exiv2::Error& e) 
     {
         kdDebug() << "Cannot get metadata tag description using Exiv2 ("
-                  << QString::fromLocal8Bit(e.what().c_str())
+                  << QString::fromAscii(e.what().c_str())
                   << ")" << endl;
         return i18n("No description available");
     }



More information about the Digikam-devel mailing list