[英]How to send UTF-8 encoded string through QTcpSocket in Qt?
I am able to send a string through a QTcpsocket. 我可以通过QTcpsocket发送字符串。 But,by default, Qt sends the string in UTF-16 encoded format.
但是,默认情况下,Qt以UTF-16编码格式发送字符串。 I want this to be sent in UTF-8 encoded format.
我希望将其以UTF-8编码格式发送。 Is there a setting in Qt for this?
Qt中有为此设置吗?
QString::toUtf8
解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.