Commit e876640c authored by Gilbert Assaf's avatar Gilbert Assaf

Bug 262265 chmlib should not send qFatal if encoding could not be guessed

Okular sends a 'qFatal()', if no encoding could be guessed. This will also create a core dump crashing Okular and all open document in this instance.

Bugs closed: 262265

Reviewed at https://git.reviewboard.kde.org/r/130106/
parent 357f198c
......@@ -101,7 +101,8 @@ bool LCHMFileImpl::loadFile( const QString & archiveName )
// and guess the encoding
getInfoFromWindows();
getInfoFromSystem();
guessTextEncoding();
if ( !guessTextEncoding() )
return false;
// Check whether the search tables are present
if ( ResolveObject(QStringLiteral("/#TOPICS"), &m_chmTOPICS)
......@@ -1192,8 +1193,11 @@ bool LCHMFileImpl::guessTextEncoding( )
const LCHMTextEncoding * enc = 0;
if ( !m_detectedLCID || (enc = lookupByLCID (m_detectedLCID)) == 0 )
qFatal ("Could not detect text encoding by LCID");
{
qWarning ("Could not detect text encoding by LCID");
return false;
}
if ( changeFileEncoding (enc->qtcodec) )
{
m_currentEncoding = enc;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment