I am developing a chrome extension with nodejs. I used robotjs module to write some text in an input tag. It writes English characters well but when I want to write persian characters, it shows special character for each character in my string in the nodemon console (when I try console.log()), and wrong characters in the input tag. here is part of my robot.js that implements write string methods.
robot.moveMouseSmooth(280, 280); // it moves mouse pointer to the input field
robot.mouseClick(); // one click on the field
robot.typeString("سارا"); //types the string that I want
The output in the input tag is:
31
I also tried this: buf = iconv.encode("سارا", 'win1256');
encoding. it shows buffer value of my string and also is not true answer. when I try to log buf in nodemon console, it's output is:
<Buffer 3f d3 c7 d1 c7>
base on this link , robotjs module supports Unicode since v0.5.0