Why words are shuffled when I insert English words in any Arabic/Urdu/Persian text on Notepad or MS Word?
Asked Answered
O

8

36

I can write Arabic/Urdu/Persian on MS Word or Notepad just fine, but whenever I insert any English word or number, the sequence is just disturbed and seems like the all the words have been shuffled in the sentence.

Look at the example below:

یہ ایک مثال ہے اردو کی ...

Now I inserted an English word and it became:

 یہ ایک مثال ہےword  اردو کی ...

So you can see almost all of the words have been jumbled ... what is the solution for that ?

Overtrade answered 8/3, 2012 at 6:12 Comment(0)
S
25

For example:

باللغة العربية “keyboard” انا أريد أن أعرف الكلمة

  1. Finish typing the Arabic word and add a space after it (this space separates the embedded text from the Arabic text to its right).
  2. Insert special character U+200F (to render the preceding space an Arabic character). The character name is "Right to Left Mark".
  3. Insert special character U+202A (to begin the left-to-right embedding). The character name is "Left to Right Embedding".
  4. Insert another space (to separate the embedded text from the Arabic text that will continue to its left).
  5. Change the keyboard to e.g. English and type the left-to-right word.
  6. Insert special character U+202C (to restore the bidrectional state to what it was before the left-to-right embedding). The Character name is "Pop directional formatting".
  7. Change the keyboard back and continue writing in Arabic.

If you're working in Microsoft Office or Open Office, the "special characters" can be found under "insert" [Insert -> symbols -> other symbols -> special characters in MS 2013]. Scroll through until you find the character with the appropriate Unicode number, and if the Unicode number does not appear in your version of MS Word, select it by its name [as indicated above].

You can also add the character by writing it's unicode and then selecting it and pressing Alt+X - but that can be confusing because it needs constant change between Arabic and English.

All of the special characters involved in this little manoeuvre are invisible characters (their job is simply to change the direction of the text) so don't be surprised if it looks like you're not inserting anything.

Pay attention to select the RTL option from the ribbon when the majority of your paragraph is RTL and keep it selected [as shown in the picture in this answer https://mcmap.net/q/420991/-why-words-are-shuffled-when-i-insert-english-words-in-any-arabic-urdu-persian-text-on-notepad-or-ms-word ].

Shush answered 5/12, 2012 at 11:54 Comment(2)
Interesting. there's also 200E. I've managed to mix hebrew and english with just 200E and 200F e.g. type a hebrew letter, thne the cursor ends up on the left, not where I want it when I want to write some english, so I put in a 200E(that's LTR) then can type english. But after any hebrew char I think I have to throw in the LTR(200E) to get any english after(to the right of) it.Boeke
In your example, can you please add the unicode characters and update the post. @ElliotBillon
A
9

This is OK; they're not shuffled: you're seeing them in LTR rendering mode.

You just need to make them right-to-left. In Notepad or Word, press right Ctrl+Shift to make their direction right-to-left and it will be okay. (It's like having <p dir="rtl">...</p> in HTML).

The control characters LRE and RLE (0x202A and 0x202B) and also LRM and RLM (0x200E and 0x200F) need to be applied to the whole paragraph, i.e they should come at the beginning of the sequence. Some text display widgets of some platforms may discard these control characters though, particularly older (pre-2000) platforms or those who do not support Unicode bidirectional algorithm correctly. Newer OS'es and programs should be fine; try with Windows Notepad for example.

I personally recommend using the platform's means to make the text RTL, and avoid special control characters because they're invisible and may cause surprising results if they go out of control. So you'd better use Word's API to make the text RTL, or if your output is HTML put them in <div dir="rtl">...</div> tags. For plain text file, user has to manually press the Ctrl+Shift keys himself.

Absolutely answered 8/3, 2012 at 10:14 Comment(3)
Yes Im working on plain text, what to press with "Crtl+Shift" to insert english letters ?Overtrade
All of the Unicode-aware applications respect these control characters. Test it with notepad dotancohen.com/howto/…Pardoes
dir="rtl" helpedSiphonostele
D
9
  1. Before you start typing in Arabic/Persian make sure you have chosen "Right-to-Left-Direction" button. This button can be found on Paragraph tab just left side of AZ sorting button. Also select "Align Text Right" button which can be found in Paragraph tab left side of Justify button.

  2. Start typing your language

  3. Before putting an English word put an space then select left ALT + SHIFT and type your English word

  4. Once finished your English words select right ALT + SHIFT and then put a space and keep typing your language again

Hope this helps

Deception answered 11/1, 2014 at 11:19 Comment(2)
P.S: that's on windows.Boscage
The above works GREAT in Word 2021 on Win10 with Hebrew. Thank you!Leanora
I
7

Edit: this was written as a clarification answer to the first answer here, I later edited the first answer and added the important notes I wrote here [the edit still needs approval though].


I was able to fix my text by following the steps in the first answer here. In case anyone faces troubles while following the steps, let me clarify some things:

If you are entering an English word in an Arabic text, make sure that RTL option in the ribbon is selected [circled in red in the following figure]:

screenshot

Keep it selected throughout the paragraph irrespective of the language you are using [as long as the majority of the paragraph is written in an RTL language like Arabic or Hebrew].

Where to find the special characters and how to insert them:

You can write the unicode of the character and then select it and press "Alt + X". However, this can be a bit confusing because of the need to change back and forth between English and Arabic to write the codes, so the best thing to do is enter them 'manually' by inserting their names.

You can do that by going to Insert -> Symbol -> More Symbols -> Special characters [scroll down]. Then select the name of the characters you need to use instead of its unicode.

The names of the characters you'll need to use [as specified in the first answer here] are:

  • "Right to Left Mark" : U+200F.
  • "Left to Right Embedding": U+202A.
  • "Pop Directional Formatting": U+202C.

As the first answer says, nothing will appear on the screen because it's a non-printing character, so it's normal if you felt like nothing happened when you insert.

If you need to do it the other way around, that is, insert a Hebrew or Arabic word in an English text, just reverse the use of unicodes -- Or follow the steps in the following link: https://superuser.com/a/1247476/767967

If you want to know more about what the special characters do and what it means to make your paragraph LTR or RTL, visit the following link: http://dotancohen.com/howto/rtl_right_to_left.html#Directionality

Inhumane answered 5/9, 2017 at 8:19 Comment(0)
B
5

Select the paragraph (e.g. using triple click) and use the button for right-to-left direction (¶◀) in the Paragraph section of the Start pane.

As Hossein’s answer explains, the issue is the directionality in the paragraph. It changes to left to right when you insert a Latin letter, and you need to fix this manually.

Billhead answered 22/5, 2012 at 13:54 Comment(1)
This is the best and most easy solution. No need to add unicode or special characters.Tripping
P
3

You need to add an invisible RLE Unicode Character at the start of the line [^]. It's : 0x202B hex = 8235 decimal or RIGHT-TO-LEFT EMBEDDING (RLE). It's necessary for Notepad but MS-Word is able to handle it. you need to right align your text correctly.

How to enter RLE: http://www.fileformat.info/tip/microsoft/enter_unicode.htm

Pardoes answered 8/3, 2012 at 7:25 Comment(3)
I tried to insert that character by using the method given in both web sites, but still the same thing, and yes I did it in Notepad.Overtrade
more info: dotancohen.com/howto/rtl_right_to_left.html + It has the RLE char at the end of the page. press at the select button and then ctrl+c to copy it. now paste it to notepad and start writing both ltr and rtl parts without problem.Pardoes
2nd approach to add RLE char is displayed here: microsoft.com/middleeast/msdn/control.aspx#SamplesPardoes
B
1

In word processing, you have a main text direction which is either left-to-right or right-to-left (or top to bottom, but let's ignore that :-), and you have a text direction for individual characters, which will also be left to right or right to left.

The word processor splits the text into chunks of strings with the same character ordering, then displays these chunks according to the main text ordering.

It seems that your main text ordering was left to right. As long as all your text is arabic, there is just one chunk with arabic text. You see already it is displayed left aligned and not right aligned because the text ordering is left to right. The characters are displayed right to left because that is how arabic is displayed.

When you inserted latin text, you had three chunks: Arabic, latin, arabic. These three chunks are displayed left to right because that is the main text ordering. That would be fine for text that is mostly latin (like "The arabic words for dog and cow are ... and ..."). For text that is mostly arabic with the occasional latin word, you need to change the main text ordering to "right to left".

Boykins answered 27/5, 2015 at 12:35 Comment(0)
S
-1

Just follow this:

  • Copy and paste the arabic text into from word or text document to ADOBE Illustrator.
  • Save the illustrator document as in .EPS format.
  • Open indesign and place the .EPS document into the place you want.

Since indesign can't handle arabic text issue by it self, this method will help many designers.

Scowl answered 26/9, 2013 at 12:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.