diff --git a/CPP/7zip/Archive/Zip/ZipItem.cpp b/CPP/7zip/Archive/Zip/ZipItem.cpp index 38a6733..8469087 100644 --- a/CPP/7zip/Archive/Zip/ZipItem.cpp +++ b/CPP/7zip/Archive/Zip/ZipItem.cpp @@ -624,10 +624,10 @@ void CItem::GetUnicodeString(UString &res, const AString &s, bool isComment, boo iconv_close(cd); - AString sUtf8CorrectLength; size_t dstCorrectLength = dst - dstStart; - sUtf8CorrectLength.SetFrom(sUtf8, static_cast(dstCorrectLength)); - if (ConvertUTF8ToUnicode(sUtf8CorrectLength, res) /*|| ignore_Utf8_Errors*/) + sUtf8.ReleaseBuf_SetEnd(static_cast(dstCorrectLength)); + + if (ConvertUTF8ToUnicode(sUtf8, res) /*|| ignore_Utf8_Errors*/) return; } }