When System Events uses keystroke or key code it does so in the context of the selected input source as listed in: System Preferences > Keyboard > Input Sources
In other words, using the Google Translate of "How can this be done?" in Russian, "Как это можно сделать с помощью?", copied to the clipboard and my current input source is U.S., then System Events outputs: aaa aaa aaaaa aaaaaaa a aaaaaaa?
To get "Как это можно сделать с помощью?" one needs to manually switch or programmatically switch the input source to e.g. Russian while System Events uses keystroke to produce the desired results.
The example AppleScript code, shown below, was tested in Script Editor under macOS Catalina with Language & Region settings in System Preferences set to English (US) — Primary and two input sources in System Preferences > Keyboard > Input Sources, U.S. and Russian, and worked for me without issue1.
- 1 Assumes necessary and appropriate settings in System Preferences > Security & Privacy > Privacy have been set/addressed as needed.
Example AppleScript code:
set the clipboard to "Как это можно сделать с помощью?"
set theRussianText to the clipboard
my writeString(theRussianText)
to writeString(theString)
set theStringList to characters of theString
tell application "System Events"
key code 49 using control down -- ⌃Space
delay 0.25
repeat with thisCharacter in theStringList
keystroke thisCharacter
delay (random number from 0.05 to 0.25)
end repeat
key code 49 using control down -- ⌃Space
end tell
end writeString
Notes:
This uses the default keyboard shortcut, in System Preferences > Keyboard > Shortcuts > Input Sources, to select the previous input source and since I only have two listed and was already set to U.S., ⌃Space switched to Russian and then back to U.S. when executed a second time.
If you have more than two input sources in System Preferences > Keyboard > Input Sources, then you will need to go about it differently.
As an example, I used the third-party utility InputSourceSelector, as in the following example AppleScript code:
set the clipboard to "Как это можно сделать с помощью?"
set theRussianText to the clipboard
my writeString(theRussianText)
to writeString(theString)
set theStringList to characters of theString
my switchInputSourceTo("com.apple.keylayout.Russian")
delay 0.25
tell application "System Events"
repeat with thisCharacter in theStringList
keystroke thisCharacter
delay (random number from 0.05 to 0.25)
end repeat
end tell
my switchInputSourceTo("com.apple.keylayout.US")
end writeString
to switchInputSourceTo(thisInputSource)
do shell script ¬
"/usr/local/bin/InputSourceSelector" & ¬
space & "select" & space & thisInputSource
end switchInputSourceTo
As you can see at the bottom of this clipped screenshot, from Script Editor, shown in purple text, "Как это можно сделать с помощью?" was typed.

Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g. delay 0.5, with the value of the delay set appropriately.