EWS正文字段已更改为Unicode字符

时间:2019-06-03 12:56:48

标签: outlook exchangewebservices office365-apps

我正在尝试使用ews api恢复icalender事件。但是,当我在正文字段中使用Unicode字符时,还原后用户帐户中的字符就会更改。

我尝试使用encode('utf'),但仍然遇到相同的问题

我的示例代码如下-

self.event = icalendar.Event()
if data['body']['content_type']:
    content_type = data['body']['content_type'].lower()
    if(content_type == 'text'):
        self.event.add('description', data['body']['content'])
    elif(content_type == 'html'):
        self.event.add('X-ALT-DESC;FMTTYPE=text/html', data['body']['content'])

我正在使用肥皂消息将此代码发送到此ews api

https://outlook.office365.com/EWS/Exchange.asmx

因此,Outlook日历事件已成功恢复,没有任何问题,但是当事件正文中包含Unicode字符时,则恢复时会对其进行更改

0 个答案:

没有答案