dotnet / MQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
MIT License
4.51k stars 1.07k forks source link

Question:can server send the message is encoded by 'gb2312' ? #956

Closed liugan123 closed 4 years ago

liugan123 commented 4 years ago

PS:i'm so sorry because my English is terible. QQ截图20200715093713 QQ截图20200715093731

meanshe commented 4 years ago

@liugan123
UTF-8 is used for string payload. It looks like your MQTTClient tool is not supported utf-8. If the client is wroted by MQTTnet or wanna sending payload encoded by 'gb2312', you should send byte[] data and decode it by yourself.

liugan123 commented 4 years ago

@meanshe Thank you for your answer.