diff --git a/src/ATBAPP/ATBDeviceControllerPlugin.cpp b/src/ATBAPP/ATBDeviceControllerPlugin.cpp index 3f8f43e..4d0dc08 100644 --- a/src/ATBAPP/ATBDeviceControllerPlugin.cpp +++ b/src/ATBAPP/ATBDeviceControllerPlugin.cpp @@ -98,6 +98,16 @@ PLUGIN_STATE ATBDeviceControllerPlugin::initDCPlugin(QObject *eventReceiver, con // text encoding for printer this->codec = QTextCodec::codecForName(printerEncoding); + if (this->codec == nullptr) { + printerEncoding = "ISO 8859-1"; + qCritical() << "ATBDeviceControllerPlugin: ERROR: printer encoding \"" << printerEncoding << "\" is not supported!"; + qCritical() << " ... use default encoding: " << printerEncoding; + this->codec = QTextCodec::codecForName(printerEncoding); + } + else { + qCritical() << "ATBDeviceControllerPlugin: Set printer encoding to " << printerEncoding; + } + this->diag->init(this->hw, this->eventReceiver); this->pluginState = PLUGIN_STATE::INITIALIZED;