Skip to main content
Inspiring
November 29, 2016
Question

Read text file with emojis

  • November 29, 2016
  • 0 replies
  • 513 views

Hi everyone,

I need to load a file with emojis to Photoshop (don't ask...) and I'm having a problem choosing a right encoding.

Is there even an encoding for this?

var testLine = "test    string with emojis   ",

    fileIn = new File(Folder.desktop + "/temp/11.txt"); //file with the same string

fileIn.encoding = "UTF-8"; //default I use one

fileIn.open('r');

var lines = [];

while (!fileIn.eof) {

    lines.push(fileIn.readln());

}

alert(testLine + "\n" + lines);

And here's the result: the test string works, but the one I got from the file doesn't

Thanks!

This topic has been closed for replies.