\tHello\n\tworld!
Hello world!
C++ (Qt)QString text = ...; // "\tHello\n\tworld!" QByteArray utf8_text = QString::toUtf8( text );QByteArray formated_utf8_text( utf8_text.count(), '\0' );qsnprintf( formated_utf8_text.data(), formated_utf8_text.count(), utf8_text.constData() ); QString formated_text = QString::fromUtf8( formated_utf8_text );