Using adb shell instead of sendkeys

I use adb shell instead of sendkeys
because sendkeys doesn’t work for me
I success to write in english .
but when i run from command line in hebrew i get this exception :

Exception occurred while executing ‘text’:
java.lang.NullPointerException: Attempt to get length of null array
at com.android.server.input.InputShellCommand.sendText(InputShellCommand.java:318)
at com.android.server.input.InputShellCommand.runText(InputShellCommand.java:290)
at com.android.server.input.InputShellCommand.onCommand(InputShellCommand.java:231)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.input.InputManagerService.onShellCommand(InputManagerService.java:5841)
at android.os.Binder.shellCommand(Binder.java:1085)
at android.os.Binder.onTransact(Binder.java:903)
at android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:1734)
at android.os.Binder.execTransactInternal(Binder.java:1321)
at android.os.Binder.execTransact(Binder.java:1280)
thanks

adb command does not support Unicode characters input, so this is expected.
Make sure the driver is up to date and try https://github.com/appium/appium-uiautomator2-driver#mobile-type