Show warning if no available codec for code page when export in dxf.
--HG-- branch : develop
This commit is contained in:
parent
63c4725e81
commit
110aa16650
|
@ -5,6 +5,8 @@
|
|||
#include <QString>
|
||||
#include <QTextCodec>
|
||||
#include "../drw_base.h"
|
||||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../ifc/exception/vexception.h"
|
||||
|
||||
DRW_TextCodec::DRW_TextCodec()
|
||||
: version(DRW::AC1021),
|
||||
|
@ -69,6 +71,14 @@ void DRW_TextCodec::setCodePage(const std::string *c, bool dxfFormat){
|
|||
conv = QTextCodec::codecForName("UTF-16");
|
||||
}
|
||||
}
|
||||
|
||||
if (conv == nullptr)
|
||||
{
|
||||
const QString errorMsg = QCoreApplication::translate("DRW_TextCodec", "No available codec for code page '%1'.")
|
||||
.arg(cp.c_str());
|
||||
qApp->IsPedantic() ? throw VException(errorMsg) :
|
||||
qWarning() << VAbstractApplication::patternMessageSignature + errorMsg;
|
||||
}
|
||||
}
|
||||
|
||||
std::string DRW_TextCodec::toUtf8(const std::string &s) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user