In short - what is the JavaScript for Mac Automation equivalent of AppleScript\'s as «class utf8»
?
I have a unicode string that I\'m t
While I was unable to find a way to do it with JavaScript only, I ended up utilizing the Objective-C Bridge to accomplish UTF-8 file write-out.
Here is the code that I used. This is JavaScript code that invokes the Objective-C NSString class, and it replaces the writeTextToFile
function that I mentioned above altogether:
objCText = $.NSString.alloc.initWithUTF8String(text);
objCText.writeToFileAtomically(filePathString, true);