[ExtendScript] Line feed \u000A character assigned to text contents is converted to carriage return
MacOS 13.3.1, Adobe Illustrator 27.4.1
Also reported on Windows same version of Illustrator.
Steps to reproduce.
To see problem, run this script
```
(function () {
var doc = app.documents.add();
var tf1 = doc.textFrames.add();
tf1.position = [100, 100];
tf1.contents = 'Break\u000Ame.';
alert('Linefeed (10)\n charCode = ' + tf1.contents.charCodeAt(5));
var tf2 = doc.textFrames.add();
tf2.position = [200, 100];
tf2.contents = 'Break\u0003me.';
alert('End-of-text (3)\n charCode = ' + tf2.contents.charCodeAt(5));
})();
```
I would expect the text on the left to have a line feed (u+000A) character, but it is converted to a carriage return (u+000D).
The text on the right is a workaround, using an unexpected character (u+0003).
There is a discussion here.
This silent conversion is unexpected, and never wanted by the user (the scripter).
2
votes
