QTextCodec *wincodec = QTextCodec::codecForName("Windows-1251");QString text = ui->lineEdit_2->text();text = wincodec->fromUnicode(text).toPercentEncoding();