octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.38k stars 961 forks source link

5-Digit Unicode Characters Don't Work #633

Open anonymousperson1209 opened 3 years ago

anonymousperson1209 commented 3 years ago

Unicode characters that are 5 digits (e.g. U+1D44E π‘Ž) don't work.

Expected Behavior

robot.typeString('ÀçćéñtΓ©d');
robot.typeString('δ½ ε₯½ε—οΌŸ');
robot.typeString('πŸ˜†πŸ’©πŸŒΊπŸ˜πŸ‘πŸ˜ πŸ πŸ˜πŸ˜’πŸ€£πŸ˜’πŸ¦‘π‘Ž');

should result in

ÀçćéñtΓ©dδ½ ε₯½ε—οΌŸπŸ˜†πŸ’©πŸŒΊπŸ˜πŸ‘πŸ˜ πŸ πŸ˜πŸ˜’πŸ€£πŸ˜’πŸ¦‘π‘Ž

Current Behavior

ÀçćéñtΓ©dδ½ ε₯½ε—οΌŸο˜†ο’©οŒΊο˜ο‘ο˜ ο ο˜ο˜’ο€£ο˜’ο¦‘ν‘Ž

Possible Solution

The issue appears to be that only the last four characters are kept (e.g. U+1D44E π‘Ž β†’ U+D44E ν‘Ž).

I think @zz85 fixed the issue, but it must have been undone at some point because his file does not match the live codebase's version of the file anymore.

Steps to Reproduce (for bugs)

  1. npm i git+https://github.com/octalmage/robotjs
  2. Create main.js with
    var robot = require('robotjs');
    robot.typeString('ÀçćéñtΓ©d');
    robot.typeString('δ½ ε₯½ε—οΌŸ');
    robot.typeString('πŸ˜†πŸ’©πŸŒΊπŸ˜πŸ‘πŸ˜ πŸ πŸ˜πŸ˜’πŸ€£πŸ˜’πŸ¦‘π‘Ž');
  3. node main.js

Context

I need to type math characters (e.g. U+1D44E π‘Ž).

Your Environment