--- ./digikam/digikam/albumsettings.h.encode	2006-12-17 12:13:08.000000000 +0200
+++ ./digikam/digikam/albumsettings.h	2007-02-04 14:13:28.000000000 +0200
@@ -223,6 +223,9 @@
     void    setShowTrashDeleteDialog(bool val);
     bool    getShowTrashDeleteDialog() const;
 
+    void    setIptcEncoding(const QString& encoding);
+    QString getIptcEncoding() const;
+    
     static AlbumSettings *instance();
 
 private:
--- ./digikam/digikam/albumsettings.cpp.encode	2006-12-17 12:13:08.000000000 +0200
+++ ./digikam/digikam/albumsettings.cpp	2007-02-04 14:13:28.000000000 +0200
@@ -83,7 +83,7 @@
     bool saveIptcTags;
     bool saveIptcPhotographerId;
     bool saveIptcCredits;
-
+    
     bool saveComments;
     bool saveDateTime;
 
@@ -101,6 +101,7 @@
     QString      credit;
     QString      source;
     QString      copyright;
+    QString      iptcEncoding;
 
     QStringList  albumCollectionNames;
 
@@ -257,7 +258,7 @@
     d->tooltipShowComments   = config->readBoolEntry("ToolTips Show Comments", true);
     d->tooltipShowTags       = config->readBoolEntry("ToolTips Show Tags", true);
     d->tooltipShowRating     = config->readBoolEntry("ToolTips Show Rating", true);
-
+    
     // ---------------------------------------------------------------------
 
     config->setGroup("EXIF Settings");
@@ -273,7 +274,8 @@
     d->saveIptcRating         = config->readBoolEntry("Save IPTC Rating", false);
     d->saveIptcPhotographerId = config->readBoolEntry("Save IPTC Photographer ID", false);
     d->saveIptcCredits        = config->readBoolEntry("Save IPTC Credits", false);
-
+    d->iptcEncoding           = config->readEntry("IPTC Encoding");
+    
     d->saveComments           = config->readBoolEntry("Save EXIF Comments", false);
     d->saveDateTime           = config->readBoolEntry("Save Date Time", false);
 
@@ -363,6 +365,8 @@
     config->writeEntry("IPTC Credit", d->credit);
     config->writeEntry("IPTC Source", d->source);
     config->writeEntry("IPTC Copyright", d->copyright);
+    
+    config->writeEntry("IPTC Encoding", d->iptcEncoding, true, true); // write to kdeglobals
 
     // ---------------------------------------------------------------------
 
@@ -931,6 +935,16 @@
     return d->showTrashDeleteDialog;
 }
 
+void AlbumSettings::setIptcEncoding(const QString& encoding)
+{
+  d->iptcEncoding = encoding;
+}
+
+QString AlbumSettings::getIptcEncoding() const
+{
+  return d->iptcEncoding;
+}
+
 bool AlbumSettings::showToolTipsIsValid() const
 {
     if (d->showToolTips)
--- ./digikam/libs/dmetadata/dmetadata.cpp.encode	2007-02-04 14:13:28.000000000 +0200
+++ ./digikam/libs/dmetadata/dmetadata.cpp	2007-02-04 14:13:28.000000000 +0200
@@ -38,6 +38,9 @@
 #include <kapplication.h>
 #include <kstringhandler.h>
 #include <ktempfile.h>
+#include <kglobal.h>
+#include <kcharsets.h>
+#include <kconfig.h>
 
 // Exiv2 includes.
 
@@ -1020,7 +1023,7 @@
 
             if (it != iptcData.end())
             {
-                QString IptcComment = QString::fromLatin1(it->toString().c_str());
+                QString IptcComment = convertFromIptcEncoding(it->toString()); // QString::fromLatin1();
 
                 if (!IptcComment.isEmpty() && !IptcComment.stripWhiteSpace().isEmpty())
                   return IptcComment;
@@ -1082,7 +1085,7 @@
 
         QString commentIptc = comment;
         commentIptc.truncate(2000);
-        d->iptcMetadata["Iptc.Application2.Caption"] = commentIptc.latin1();
+        d->iptcMetadata["Iptc.Application2.Caption"] = convertToIptcEncoding(commentIptc);
 
         setImageProgramId();
         return true;
@@ -2121,4 +2124,31 @@
     *denominator = (int)denTemp;
 }
 
+QTextCodec* DMetadata::iptcEncodingCodec()
+{
+  KConfig *config = kapp->config();
+  config->setGroup("Metadata Settings");
+  QString iptcEncoding = config->readEntry("IPTC Encoding");
+  
+  if (iptcEncoding.isEmpty() || iptcEncoding == "ASCII")
+    return NULL;
+  else return KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(iptcEncoding));
+}
+
+QString DMetadata::convertFromIptcEncoding(const std::string &value) const
+{
+  QTextCodec *codec = iptcEncodingCodec();
+      
+  if (codec) return codec->toUnicode(value.c_str());
+  else return QString::fromAscii(value.c_str());
+}
+
+std::string DMetadata::convertToIptcEncoding(const QString &value) const
+{
+  QTextCodec *codec = iptcEncodingCodec();
+  
+  if (codec) return std::string(codec->fromUnicode(value));
+  else return std::string(value.ascii());
+}
+
 }  // NameSpace Digikam
--- ./digikam/libs/dmetadata/dmetadata.h.encode	2006-12-17 12:13:08.000000000 +0200
+++ ./digikam/libs/dmetadata/dmetadata.h	2007-02-04 14:13:28.000000000 +0200
@@ -145,12 +145,15 @@
 
     static QString convertCommentValue(const Exiv2::Exifdatum &comment);
     static QString detectEncodingAndDecode(const std::string &value);
+    static QTextCodec *iptcEncodingCodec();
 
 private:
 
     bool setImageProgramId();
     void convertToRational(double number, long int* numerator, 
                            long int* denominator, int rounding);
+    QString convertFromIptcEncoding(const std::string &value) const;
+    std::string convertToIptcEncoding(const QString &value) const;
 
 private:
 
--- ./digikam/libs/widgets/metadata/iptcwidget.cpp.encode	2007-02-04 14:36:50.000000000 +0200
+++ ./digikam/libs/widgets/metadata/iptcwidget.cpp	2007-02-04 14:54:21.000000000 +0200
@@ -29,6 +29,7 @@
 
 #include <qmap.h>
 #include <qfile.h>
+#include <qtextcodec.h>
 
 // KDE includes.
 
@@ -122,6 +123,7 @@
         
         QString ifDItemName;
         MetaDataMap metaDataMap;
+        QTextCodec *codec = DMetadata::iptcEncodingCodec();
 
         for (Exiv2::IptcData::iterator md = iptcData.begin(); md != iptcData.end(); ++md)
         {
@@ -130,7 +132,9 @@
             // Decode the tag value with a user friendly output.
             std::ostringstream os;
             os << *md;
-            QString value = QString::fromAscii(os.str().c_str());
+            QString value;
+            if (codec) value = codec->toUnicode(os.str().c_str());
+            else value = QString::fromAscii(os.str().c_str());
             // To make a string just on one line.
             value.replace("\n", " ");
 
--- ./digikam/utilities/setup/setupmetadata.cpp.encode	2006-12-17 12:13:08.000000000 +0200
+++ ./digikam/utilities/setup/setupmetadata.cpp	2007-02-04 14:13:28.000000000 +0200
@@ -43,6 +43,8 @@
 #include <kglobalsettings.h>
 #include <kstandarddirs.h>
 #include <kapplication.h>
+#include <kcombobox.h>
+#include <kcharsets.h>
 
 // // Local includes.
 
@@ -67,6 +69,7 @@
         saveDateTimeBox           = 0;
         savePhotographerIdIptcBox = 0;
         saveCreditsIptcBox        = 0;
+        iptcEncodingCombo         = 0;
     }
 
     bool       ExifAutoRotateAsChanged;
@@ -80,6 +83,7 @@
     QCheckBox *saveDateTimeBox;
     QCheckBox *savePhotographerIdIptcBox;
     QCheckBox *saveCreditsIptcBox;
+    KComboBox *iptcEncodingCombo;
 };
 
 SetupMetadata::SetupMetadata(QWidget* parent )
@@ -125,6 +129,17 @@
     QWhatsThis::add( d->saveCreditsIptcBox, i18n("<p>Turn this option on to store the default "
                                                  "credit and copyright identity into the IPTC tags. "
                                                  "You can set this value in the Identity setup page."));
+    
+    QHBox *box = new QHBox(IptcGroup);
+    box->setSpacing(10);
+    QLabel *iptcEncodingLabel = new QLabel(i18n("IPTC Encoding:"), box);
+    d->iptcEncodingCombo = new KComboBox(box);
+    iptcEncodingLabel->setBuddy(d->iptcEncodingCombo);
+    QWhatsThis::add( d->iptcEncodingCombo, i18n("<p>Encoding for IPTC caption and other text tags"));
+    d->iptcEncodingCombo->insertStringList(KGlobal::charsets()->descriptiveEncodingNames());
+    d->iptcEncodingCombo->insertItem("ASCII", 0);
+    box->setStretchFactor(iptcEncodingLabel, 0);
+    box->setStretchFactor(d->iptcEncodingCombo, 1);
                                                            
     mainLayout->addWidget(IptcGroup);
 
@@ -204,6 +219,7 @@
     settings->setSaveIptcTags(d->saveTagsIptcBox->isChecked());
     settings->setSaveIptcPhotographerId(d->savePhotographerIdIptcBox->isChecked());
     settings->setSaveIptcCredits(d->saveCreditsIptcBox->isChecked());
+    settings->setIptcEncoding(d->iptcEncodingCombo->currentText());
 
     settings->saveSettings();
 }
@@ -222,6 +238,17 @@
     d->saveTagsIptcBox->setChecked(settings->getSaveIptcTags());
     d->savePhotographerIdIptcBox->setChecked(settings->getSaveIptcPhotographerId());
     d->saveCreditsIptcBox->setChecked(settings->getSaveIptcCredits());
+    
+    bool found = false;
+    for (int i = 0; i < d->iptcEncodingCombo->count(); i++)
+    {
+      if (d->iptcEncodingCombo->text(i) == settings->getIptcEncoding()) {
+        d->iptcEncodingCombo->setCurrentItem(i);
+        found = true;
+        break;
+      }  
+    }
+    if (!found) d->iptcEncodingCombo->setCurrentItem(0);
 }
 
 bool SetupMetadata::exifAutoRotateAsChanged()
