FIXED: Problem with new properties of document object
Posted: 30 Sep 2016 09:42
I tried out new properties of document object; for this I used the code you gave as example, i.e.
I saved it to .jsfs file, though. Running the script through "Run script" button with "User script" toolbar on, on a file in the right view of "Dual document view", gives unexpected results: only NewlineFormat works well. UseBOM never changes BOM (i.e. doesn't add nor delete, if it is present.) "CodePage = 65001" garbles text if it was ANSI-encoded.
On the other hand, this one-liner
works flawlessly.
Code: Select all
Document.CodePage = 65001; // Change encoding to UTF-8
Document.UseBOM = true; // Use a BOM when saving file
Document.NewlineFormat = "Unix"; // Convert to Unix linefeeds (LF)
On the other hand, this one-liner
Code: Select all
MainApp.NewDocumentEx(".html", 65001, true, "Unix");