我有网址:https://example.com/hello?param=first:last
。我希望它应该被百分比编码为https://example.com/hello?param=first%3Alast
. 但 Qt 保持原样。我的代码:
QUrl url("https://example.com/hello?param=first:last");
printf("Encoded: %s\n", url.toEncoded().constData());
我应该如何编码冒号?手动格式化参数QString::toPercentEncoding
?