When getting ink.name, encoding gets broken for non-Latin languages: Chinese, Japanese, Russian, etc.
A script cannot support Chinese, Japanese and other languages when getting ink.name, and it displays garbled characters.
var doc = app.activeDocument;
var inkList = doc.inkList;
var inkUsage = [];
for (var i = 0; i < inkList.length; i++) {
var ink = inkList[i];
var inkName = ink.name;
inkUsage.push(inkName);
}
alert(inkUsage.join("\n"));
$.write(inkUsage.join("\n"));
This test script above gives a result like in the screenshot attached.
Problem found by Aprking
Original discussion:
https://community.adobe.com/t5/illustrator-discussions/how-to-make-the-script-support-chinese-japanese-and-other-languages-when-getting-ink-name/m-p/14247791
6
votes
AdminEgor Chistyakov
(Admin, Adobe Illustrator)
shared this idea