Autohotkey ComObjActive Outlook wrong encoding of umlauts

谁都会走 提交于 2019-12-24 20:16:04

问题


Currently i use Autohotkey to prefill Emails with Text and Attachments.

tml_body=
  (
  <html>
    <body>

      test

    </body>
  </html>
  )

m := ComObjActive("Outlook.Application").CreateItem(0)
m.Subject := "subject with umlauts äüö "
m.To := "foo@bar.com"
m.CC := "foo@bar.com"
m.HTMLBody := html_body
m.Display
;m.attachments.add("filepath")

WinWait Untitled - Message (HTML)
WinActivate Untitled - Message (HTML)

Using this script opens a new outlook mail with the following subject "subject with umlauts äüö " In the hmtlbody something like &uuml; works but not in the subject.

How can i set or encode a subject to display special characters / umlauts correctly?


回答1:


Try saving the code in UTF-8 format.

e.g.

  • In Notepad choose File --> Save As... --> Encoding --> UTF-8
  • in Notepad++ choose Encoding --> Encode in UTF-8


来源:https://stackoverflow.com/questions/47590027/autohotkey-comobjactive-outlook-wrong-encoding-of-umlauts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!