QMap<QString, QString> example { {"а", "$$$"}, {"б", "$$%"}, {"в", "$%%"}, {"a", "-1-"}, {"b", "-+="}, {"c", "dna"}, {"d", "dsv"} } ba = text.toLocal8Bit(); char texter[10000]; for (col=0;col<=text.length();col++){ it = example.begin(); texter[col] = ba[col]; while(it != example.end()){ it++; if(it.key() == texter[col]){ hash_string_text += it.value(); break; } } With characters in English. Everything is normal. But if you look for keys written in Russian, they are not visible.