1

I am having a challenge implementing BiDi characters as the arabic characters are shifted to different positions during construction of an object key.

enter image description here

Could someone please help me understand the behavior and a solution

Because I use the similar kind of thing to modify the strings I get undesired affects

enter image description here

Raviteja Avvari
  • 252
  • 4
  • 14
  • The below solved my issue [Click here](https://stackoverflow.com/questions/29988144/concat-rtl-string-with-ltr-string-in-javascript) – Raviteja Avvari Nov 22 '18 at 14:10

1 Answers1

1

The phenomenon you observe is 'presentation only'. The development tools that you use to debug your javascript, are not RTL-friendly. If you suspect something went wrong for a specific value which contains Arabic characters, you can copy the value to clipboard, and paste the result to some separate viewer, preferably one that allows you to control the direction, e.g. Windows Notepad.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • Thanks for the comment. But I see this happening during string modification as well. I have added one more screen shot. Please advise – Raviteja Avvari Nov 21 '18 at 11:46
  • Exactly! It's very hard to understand the underlying order of characters looking at the string output. Maybe you can print the string out in hexadecimal format, or copy/paste the value to Notepad. Or, you need to add RLM character after `':'` to make sure each substring begins as right-to-left. – Alex Cohn Nov 21 '18 at 13:04