class UTextCodec{public: static void initTextCodecs(const char *codecName) { QTextCodec *codec = QTextCodec::codecForName(codecName); QTextCodec::setCodecForCStrings(codec); QTextCodec::setCodecForLocale(codec); QTextCodec::setCodecForTr(codec); }};
UTextCodec::initTextCodecs("cp1251");
C++ (Qt)QString str = QString::fromUtf8("Моя папочка");qDebug("Created: %d", QDir().mkdir(str));qDebug("Removed: %d", QDir().rmdir(str));