r23857 by jghali - Return from Serializer::writeWithEncoding() if requested text codec is not available

scribus-commit scribus-commit at lists.scribus.net
Fri May 29 20:42:10 UTC 2020


Author: jghali
Date: Fri May 29 20:42:10 2020
New Revision: 23857

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23857
Log:
Return from Serializer::writeWithEncoding() if requested text codec is not available

Modified:
    trunk/Scribus/scribus/serializer.cpp

Modified: trunk/Scribus/scribus/serializer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23857&path=/trunk/Scribus/scribus/serializer.cpp
==============================================================================
--- trunk/Scribus/scribus/serializer.cpp	(original)
+++ trunk/Scribus/scribus/serializer.cpp	Fri May 29 20:42:10 2020
@@ -185,6 +185,8 @@
 		codec = QTextCodec::codecForLocale();
 	else
 		codec = QTextCodec::codecForName(encoding.toLocal8Bit());
+	if (!codec) return false;
+
 	QByteArray dec = codec->fromUnicode( txt );
 	QFile f(filename);
 	if (f.open(QIODevice::WriteOnly))




More information about the scribus-commit mailing list