3

My code write Text to file in Adobe Script (.jsx):

 var xml=  " 小塚ゴシック Pro"

  var file = new File(output);
  file.open("w");   
  file.write(xml);
  file.close();

But result encode UTF-8 can't display: ϬӋēĖĢĎ Pro It only can display text " 小塚ゴシック Pro" , if set encode of file is Shift-JIS.

How write text to File by Encode UTF-8?

loxxy
  • 12,990
  • 2
  • 25
  • 56
D T
  • 3,522
  • 7
  • 45
  • 89
  • jsx isn't Javascript. Assuming you tagged the question to a wrong place, updating it for you. – loxxy Dec 31 '15 at 10:34

2 Answers2

13

Try this:

file.encoding = "UTF-8";

And here is a sample, for reference.

loxxy
  • 12,990
  • 2
  • 25
  • 56
1

I had the same issue with polish chars and had to use UTF-16 vs UTF-8.

var xml= "小塚ゴシック Pro"   
var file = new File(output);
file.encoding = "UTF-16";
file.open("w");   
file.write(xml);
file.close();
ccpotter
  • 9
  • 1