Skip to main content
Inspiring
May 2, 2017
Question

Save a file with Mac os Roman encoding?

  • May 2, 2017
  • 2 replies
  • 1370 views

Hello

Im using a creative suite html plugin and I want to save a text file. If I use the

window.cep.fs.writeFile the output seems to be limited to UTF-8 or Base64.

Im trying to save a file with Mac os roman encoding but no data gets written to the file:

var file = File(exportObject.path);

var data = exportObject.data;

file.encoding = 'MACINTOSH';

file.open('w');

alert(file.write(data));

file.close();

If I try

file.encoding = 'UTF-8'; 'BINARY* also works, but its not the format Im looking for.

According to the documentation these encoding should work but I can only get UTF-8 to work so far:

US-ASCII, ASCII,ISO646-US,I SO-646.IRV:1991, ISO-IR-6, ANSI-X3.4-1968,CP367,IBM367,US,ISO646.1991-IRV UCS-2,UCS2, ISO-10646-UCS-2 UCS2LE,UCS-2LE,ISO-10646-UCS-2LE UCS2BE,UCS-2BE,ISO-10646-UCS-2BE UCS-4,UCS4, ISO-10646-UCS-4 UCS4LE,UCS-4LE,ISO-10646-UCS-4LE UCS4BE,UCS-4BE,ISO-10646-UCS-4BE UTF-8,UTF8,UNICODE-1-1-UTF-8,UNICODE-2-0-UTF-8,X-UNICODE-2-0-UTF-8 UTF16,UTF-16,ISO-10646-UTF-16 UTF16LE,UTF-16LE,ISO-10646-UTF-16LE UTF16BE,UTF-16BE,ISO-10646-UTF-16BE CP1252,WINDOWS-1252,MS-ANSI ISO-8859-1,ISO-8859-1,ISO-8859-1:1987,ISO-IR-100,LATIN1 MACINTOSH,X-MAC-ROMAN BINARY

This topic has been closed for replies.

2 replies

Known Participant
October 24, 2017

Hi Pontus, where can I find this documentation you mentioned in the question?

Inspiring
May 2, 2017

Hello

This seems to do the trick:

file.encoding = "X-MAC-ICELANDIC"

Now I just need to find a windows encoding that works.