问题
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 ü
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