StupidBeauty
Read times:518Posted at:Fri Mar 29 01:20:52 2013
- no title specified

转载:url encoding的编码问题

使用QT开发软件时,如果想将URL以UTF8之外的非主流字符集来编码的话,就要用到QByteArray的toPercentEncdoing()方法与 QTextCodec来配合实现。

http://www.qtcn.org/bbs/read-htm-tid-44201-fpage-8.html

亮点

可以用QByteArray的toPercentEncdoing()方法,比如:

QString strUtf8 = "....";
QString strUtf8UrlEncoding = QUrl::toPercentEncoding(strUtf8);

QByteArray baGBK = QTextCodec::codecForName("GBK")->fromUnicode(strUtf8);
QString strGBKUrlEncoding(baGBK.toPercentEncoding());

未知美女

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4