QString from Punycode QUrl
QString from Punycode QUrl
如果我将url http://www.äsdf.de/bla/bla
放入QUrl
,我如何才能恢复url与原始符号?
QUrl
将修复一些字符,但我想在url中显示原始äsdf
而不是xn--sdf-pla
。
我知道QString QUrl::fromAce(const QByteArray &domain)
,但它需要QByteArray
而不是QUrl
实例。
您可以将QUrl::toDisplayString
与默认的PrettyDecoded
格式选项一起使用,或者在enum ComponentFormattingOption
中使用任何其他值:
QUrl url{"http://www.äsdf.de/bla/bla"};
QString original_string =
url.toDisplayString(); // default is QUrl::PrettyDecoded
QString original_string_with_encoded_spaces =
url.toDisplayString(QUrl::EncodeSpaces);
相关文章:
- 访问其他网站后如何获得完整(精确)的URL / QUrl地址?
- 使用“QUrl”作为文件路径馈送到“std::fstream”
- 在"QUrl"中没有名为"addQueryItem"的成员 - 将Qt 4.7转换为5.8
- QNetworkRequest and QUrl encoding c++
- 我如何在Qurl中包括一个百分点的标志
- 将调试中的QUrl可视化为VS中的字符串
- 如何在QWebEngineView中模拟linkClicked(QUrl)信号
- 如何从编码的 URL 创建 QUrl
- QUrl 解析失败
- QT:QUrl,无百分比编码
- Qt 应用程序在从 <QUrl>NetworkAccessManager->get() 回调访问 QList<QLlnkedList* >时冻结
- 删除`www.`来源于问题5.5中的QUrl
- Qt QUrl:不对冒号进行URL编码
- QString from Punycode QUrl
- QNetworkRequest URL 包含 '?' - 由于 QUrl 编码而未正确请求
- QUrl:错误的链接