mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
ZIPS: Change handling of UTF-8 encoded file names
This commit is contained in:
parent
eac157af29
commit
6238f33d1f
|
@ -187,6 +187,8 @@ bool IndexedZip::indexFile( BtreeIndexing::IndexedWords &zipFileNames )
|
|||
// Failed to decode
|
||||
}
|
||||
|
||||
if( !entry.fileNameInUTF8 )
|
||||
{
|
||||
// CP866
|
||||
try
|
||||
{
|
||||
|
@ -216,5 +218,6 @@ bool IndexedZip::indexFile( BtreeIndexing::IndexedWords &zipFileNames )
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ bool readNextEntry( QFile & zip, CentralDirEntry & entry )
|
|||
entry.compressedSize = qFromLittleEndian( record.compressedSize );
|
||||
entry.uncompressedSize = qFromLittleEndian( record.uncompressedSize );
|
||||
entry.compressionMethod = getCompressionMethod( record.compressionMethod );
|
||||
entry.fileNameInUTF8 = ( qFromLittleEndian( record.gpBits ) & 0x800 ) != 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ struct CentralDirEntry
|
|||
|
||||
quint32 localHeaderOffset, compressedSize, uncompressedSize;
|
||||
CompressionMethod compressionMethod;
|
||||
bool fileNameInUTF8;
|
||||
};
|
||||
|
||||
/// Represents contents of the local file header -- that what CentralDirEntry::
|
||||
|
|
|
@ -44,7 +44,7 @@ DEF_EX( exInvalidData, "Invalid data encountered", Dictionary::Ex )
|
|||
enum
|
||||
{
|
||||
Signature = 0x5350495a, // ZIPS on little-endian, SPIZ on big-endian
|
||||
CurrentFormatVersion = 3 + BtreeIndexing::FormatVersion
|
||||
CurrentFormatVersion = 4 + BtreeIndexing::FormatVersion
|
||||
};
|
||||
|
||||
struct IdxHeader
|
||||
|
|
Loading…
Reference in a new issue