I want to display the text layer contents of my psd on a txt file (csv format). The problem is if the the text is Arabic or Thai the text displayed is "????"
This is how i retrive the texts from the psd layers:
function TextChecker() {
LayerContent = [];
var iLayer = app.activeDocument.activeLayer.textItem;
var layerContent = iLayer.contents;
//If statement here...
//If text layer found push layer content into
//an array (LayerContent) then return
//LayerContent
return LayerContent;
}
Then I push it on a array After that i write the texts like this:
var Info = TextChecker();
Name = app.activeDocument.name.replace(/\.[^\.]+$/, ' ');
var file = new file(docRef.path + "/" + Name + ".csv");
for (var a In Info) {
//alert(Info[a]);
file.writeln(Info[a][0]);
}
I tried to display first the text before it will be writen in the text file and it displays the text properly (in arabic / thai font) but after its written the text is different.
Reasearch:
1. Found out about file.encoding, tried everything. Only UTF-8 is makes the text readable (only in Japanese katakana)
2. Instead of '.csv' file. I used '.txt' as file extension when creating a new file. And used 'file.encoding = "UTF-8"' this time the texts are displayed properly.
Question: is there a way to output arabic/thai text properly on a csv file???