Decode some html-coded symbols in stardict index

This commit is contained in:
Abs62 2013-02-18 22:10:06 +04:00
parent ec845a977e
commit 824e5846a7

View file

@ -81,7 +81,7 @@ struct Ifo
enum
{
Signature = 0x58444953, // SIDX on little-endian, XDIS on big-endian
CurrentFormatVersion = 7 + BtreeIndexing::FormatVersion + Folding::Version
CurrentFormatVersion = 8 + BtreeIndexing::FormatVersion + Folding::Version
};
struct IdxHeader
@ -1009,6 +1009,14 @@ static void handleIdxSynFile( string const & fileName,
uint32_t offset;
if( strstr( word, "&#" ) )
{
// Decode some html-coded symbols in headword
string unescapedWord = Html::unescapeUtf8( word );
strncpy( (char *)word, unescapedWord.c_str(), wordLen );
wordLen = strlen( word );
}
if ( !isSynFile )
{
// We're processing the .idx file