diff --git a/src/exif.cpp b/src/exif.cpp index 493fd20b..78c8ae08 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -226,8 +226,16 @@ namespace Exiv2 { if ( ti ) { fct = ti->printFct_; if ( ti->typeId_ == comment ) { - os << value().toString(); - fct=NULL; + fct=NULL; + const Exiv2::CommentValue* cv = dynamic_cast(&value()); + Exiv2::CommentValue::CharsetId csId = cv->charsetId(); + if ( csId != CommentValue::undefined ) { + os << "charset=" << CommentValue::CharsetInfo::name(csId) << " "; + } + os << cv->comment(); +#if 0 + os << "|| value().toString() = " << value().toString(); +#endif } } if ( fct ) fct(os, value(), pMetadata); diff --git a/src/value.cpp b/src/value.cpp index b96f7de3..99997822 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -548,10 +548,6 @@ namespace Exiv2 { std::ostream& CommentValue::write(std::ostream& os) const { - CharsetId csId = charsetId(); - if (csId != undefined) { - os << "charset=" << CharsetInfo::name(csId) << " "; - } return os << comment(); }