X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Utils.cxx;h=e3bf44671ea48214b72f8581825119bc5b269268;hb=9d134b21b1ed187851322a6b5feef3bee83b6583;hp=d539ac8a076aa8ef61c8ad14c94e343fb03f25e3;hpb=b0a908c0d20341651771d0249fb10882f54b2aad;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index d539ac8a0..e3bf44671 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -52,6 +52,10 @@ #include CORBA_SERVER_HEADER(SMESH_Group) +//VSR: uncomment below macro to support unicode text properly in SALOME +// current commented out due to regressions +//#define PAL22528_UNICODE + namespace SMESH { SUIT_Desktop* @@ -391,4 +395,27 @@ namespace SMESH return n; } + QString fromUtf8( const char* txt ) + { +#ifdef PAL22528_UNICODE + return QString::fromUtf8( txt ); +#else + return QString( txt ); +#endif + } + + QString fromUtf8( const std::string& txt ) + { + return fromUtf8( txt.c_str() ); + } + + const char* toUtf8( const QString& txt ) + { +#ifdef PAL22528_UNICODE + return txt.toUtf8().constData(); +#else + return txt.toLatin1().constData(); +#endif + } + } // end of namespace SMESH