ExtApp display uncorrectly when plugin.xml includes some non-ASCII
characters, such as Chinese character. Because it is coded in UTF-8
mode, like
simpleexample plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<extension point="org.opencherry.ui.views"> <view id="org.mitk.views.simpleexample" name="SimpleExample" -> changed this line to some Chinese characters class="::QmitkSimpleExampleView" /> </extension>
</plugin>
Then mitk should read the name in UTF-8 mode.
I added several lines to display UTF-8 characters correctly in
mitk\openCherry\Bundles\org.opencherry.ui.qt\src\internal\cherryQtShowViewAction.cpp, between
this->setParent(static_cast<QWidget*>(window->GetShell()->GetControl()));
and
this->setText(QString(desc->GetLabel().c_str())); this->setToolTip(QString(desc->GetLabel().c_str()));
// the following is added to display correctly UTF-8 caracters
QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForTr(codec);
//
Do not know whether the code fashion change affect following exectuion,
like I/O.
If I only change following two lines to
this->setText(QString::fromUtf8(desc->GetLabel().c_str())); this->setToolTip(QString::fromUtf8(desc->GetLabel().c_str()));
the menu characters is right, the control panel tilte is weird.