これは InterSystems FAQ サイトの記事です。
UTF-8(BOM付)のテキストファイルは以下のようにして作成可能です。
set f=##class(%Stream.FileCharacter).%New()
set f.TranslateTable="UTF8"
set f.BOM=($char($zhex("EF"))_$char($zhex("BB"))_$char($zhex("BF")))
set f.Filename="D:\TEST\test.txt"
set cr = $char(13)
do f.Write("1行目"_cr)
do f.Write("2行目"_cr)
set ret=f.%Save()
ObjectScriptObjectScript