Forum Discussion

gindi_khangura's avatar
gindi_khangura
Occasional Contributor
10 years ago

[Windows] Typing UTF-16 Characters

How come we cannot type UTF-16 characters into notepad (even though you can copy & paste them into notepad)?



I'm using the following VBScript:



Sub Test3

    Dim obj

    Set obj = Sys.Process("notepad").Window("Notepad", "Untitled - Notepad", 1).Window("Edit", "", 1)



    Call obj.Keys("’ËŨz€ĿЂ")

End Sub



We are not allowed to use SetText or equivalent since we are testing actual key presses. I was also attempting to use KeyDown and KeyUp, but those require an integer value for the argument that corresponds to the character; according to the documentation, the virtual key-codes can be found online at (http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx), making me think that those are the only values supported by KeyDown, and thus Keys since it is probably using KeyDown and KeyUp on the inside.



Anyone have any information to share?