Azure服务总线消息触发Azure函数(unicode消息)

Azure服务总线消息触发Azure函数(unicode消息),unicode,triggers,azure-functions,azureservicebus,Unicode,Triggers,Azure Functions,Azureservicebus,关于使用Azure Service Bus以unicode(中文字符)发送消息的问题。使用此代码发送带有unicode字符的邮件后: string msgBody = JsonConvert.SerializeObject(msg); var message = new Message(Encoding.Unicode.GetBytes(msgBody)); await QueueClient.SendAsync(message);

关于使用Azure Service Bus以unicode(中文字符)发送消息的问题。使用此代码发送带有unicode字符的邮件后:

        string msgBody = JsonConvert.SerializeObject(msg);
        var message = new Message(Encoding.Unicode.GetBytes(msgBody));
        await QueueClient.SendAsync(message);
        await QueueClient.CloseAsync();
其中msg包含中文字符。由消息触发的Azure函数因异常而崩溃:

System.Private.CoreLib:执行函数Function1时发生异常。Microsoft.Azure.WebJobs.Host:异常绑定参数“myQueueItem”。Microsoft.Azure.WebJobs.ServiceBus:ContentType为“null”的消息未能反序列化为字符串,消息为:“反序列化System.string类型的对象时出错。”。输入源的格式不正确。“。System.Private.DataContractSerialization:反序列化System.String类型的对象时出错。输入源的格式不正确。System.Private.DataContractSerialization:输入源的格式不正确


有没有想过使用Unicode消息触发Azure功能?

已修复!UTF8似乎工作得很好