QTextCodec::setCodecForLocale(QTextCodec::codecForName("windows-1251"));QString str = <value>;QByteArray ba = str.toLocal8Bit();<function_for_const_char>(ba.data());
if(strstr(curr_locale, "UTF") == NULL){ outstr = strdup(str.toLocal8Bit()); } else { outstr = strdup(str.toUtf8()); }