简体   繁体   中英

How to send UTF-8 encoded string through QTcpSocket in Qt?

I am able to send a string through a QTcpsocket. But,by default, Qt sends the string in UTF-16 encoded format. I want this to be sent in UTF-8 encoded format. Is there a setting in Qt for this?

QString::toUtf8

解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM