Replace your code with this:
void MainWindow::on_btDecode_clicked()
{
QString input
= ui
->inputText
->toPlainText
().
simplified();
ui->outputText->setText(output);
}
void MainWindow::on_btDecode_clicked()
{
QString input = ui->inputText->toPlainText().simplified();
QByteArray latin1 = input.toLatin1();
QByteArray outputBytes = QByteArray::fromBase64( latin1 );
QString output = outputBytes;
ui->outputText->setText(output);
}
To copy to clipboard, switch view to plain text mode
In the debugger, if you set a breakpoint after QByteArray:: fromBase64() and look at the contents of "outputBytes" you will see that it contains the entire decoded string. Unfortunately, the byte array contains embedded '\0' characters, which are being interpreted as string terminators. So when you copy "outputBytes" to "output", it stops when it gets to the first '\0', and that's what you see.
I don't know what this is that you are trying to decode, but it looks like a mixture of ASCII and binary, and from some of the text I read I suspect you're trying to decompile a program. That's suspicious behaviour as far as I'm concerned, so that will be the end of my help unless you can come up with a good explanation.
Bookmarks