This is doing LiveCode UTF_16 encoded data to Windows native encoded... So Decode DataRef as UTF-16 stringref, convert line endings, encode stringref as native dataref, then pad with NUL if required.