diff --git a/src/value.cpp b/src/value.cpp index d36ae8ac..b8a4f9f2 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -476,12 +476,8 @@ namespace Exiv2 { if (pos != std::string::npos) c = comment.substr(pos+1); } if (charsetId == unicode) { - if (byteOrder_ == littleEndian) { - convertStringCharset(c, "UTF-8", "UCS-2LE"); - } - else { - convertStringCharset(c, "UTF-8", "UCS-2BE"); - } + const char* to = byteOrder_ == littleEndian ? "UCS-2LE" : "UCS-2BE"; + convertStringCharset(c, "UTF-8", to); } const std::string code(CharsetInfo::code(charsetId), 8); return StringValueBase::read(code + c); diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index 02efcdf5..a8ca1a48 100644 Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ