ADD: Zip - check that filename is really in UTF-8 encoding

This commit is contained in:
Alexander Koblov 2020-06-23 18:23:40 +00:00
commit 2e39b62ca4

View file

@ -1484,7 +1484,7 @@ begin
FItemInfo.LoadFromStream( Stream );
{ decode filename (ANSI/OEM/UTF-8) }
if FItemInfo.IsUTF8 then
if FItemInfo.IsUTF8 and (FindInvalidUTF8Character(PAnsiChar(FItemInfo.FileName), Length(FItemInfo.FileName)) < 0) then
FFileName := FItemInfo.FileName
else if FItemInfo.ExtraField.Get(Ab_InfoZipUnicodePathSubfieldID, Pointer(InfoZipField), FieldSize) and
(FieldSize > SizeOf(TInfoZipUnicodePathRec)) and