When insert hebrew text to Content Control it insert bad.

Text should be inside content control.
Now text insert near control, by using
control.insertText('砖诇讜诐', Word.InsertLocation.replace);
https://gist.github.com/VitaliyLavrenko/a21af8c61af8bf92439dae8f4db5c99a
Code to insert control and text:
return Word.run(function(context) {
var range = context.document.getSelection();
var control = range.insertContentControl();
control.appearance = "Tags";
control.title = "Custom";
control.color = "green";
control.insertText('砖诇讜诐', Word.InsertLocation.replace);
return context.sync();
});
Thanks @VitaliyLavrenko for reporting this issue!
@weshi, I was able to reproduce this in windows as well. Could you please follow-up on this bug?
This issue does not repro in Word Online. @JuaneloJuanelo Could you reassign this bug?
FYI: We see the same thing with Arabic as well.
@weshi and @JuaneloJuanelo Any updates regarding this?
I can repro in windows...looks like a bug , we are tracking internally with 3679427
@VitaliyLavrenko we have an update. Are you trying the API in a Right-To-Left RTL culture ?
I was able to repro your issue, but only when I try to insert the Hebrew (who is a RTL language) into a paragraph using a LTR Culture (English on this case). Mixing a RTL and LTR text in the same paragraph is kind of a corner case. It IS valid to have multiple cultures in the same document, but you need to make sure to add them, and then you will get the tool to RTL or LTR a specific paragraph. (see ribbon image below)
So, in order for this to work correctly, I suggest you to add the Hebrew culture to your Office environment. Go to File -> Options -> Languages and please add Hebrew. Check out screenshot below.
We anyways raised the issue with the Word team, but given that there is this workaround, the fix for this potential issue might not come in the short term.
Please let us know if you observe a similar behavior.


@tsabbay my answer above applies to Arabic too and to any RTL language. thanks!
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.