I have this word document
one could produce it manually, or download it from http://ge.tt/8zgZScd2 with firefox(chrome blocks that site for no good reason). Or you can download it from here
You see four highlighted sets of characters.
The first one is hebrew then english, in left to right mode. (LTR mode)
The second third and fourth, are english then hebrew, in right to left mode. (RTL mode)
I'm using ctrl with left shift to go to LTR mode, and ctrl with right shift to switch to RTL mode.
The hebrew letters are e.g. unicode \u05D0
א
but any will do.
Here is the find and replace
So in the 'find' section, I have put in to find highlighted text. (that option exists if one clicks format..highlight, in the bottom left of that dialog box)
In the replace section I wrote XXX^&XXX
in ms word ^&
is ms word's way of saying what most would call \0
i.e. it's the text that was found. So my find and replace should be finding highlighted text and keeping it but putting an XXX before and after it.
Here is the result of that find/replace
As you can see, the first one worked. That's the one with hebrew then english and LTR mode.
The second third and fourth, failed. Those are the ones with english then hebrew in right to left mode.
I would like to get the find/replace to work for the last three, i.e. those second third and fourth, those with english then hebrew in right to left mode.
added
It looked a bit like it was wrapping the XXX around the hebrew but wasn't clear why. Though that isn't what is happening / how / why it's doing this.
Scott suggests using a replacement string of FOO^&BAR to try to determine more what's happening for the purposes of troubleshooting, and it does clarify what's happening. If you have אאאabc
in LTR mode and you replace it with FOO^&BAR
ms word sees that and shows as FOOאאאabcBAR
which is all fine. If you put that in RTL mode it doesn't make FOOabcאאאBAR
or BARabcאאאFOO
. It makes abcBARאאאFOO
(i.e. it mixed the FOO BAR into it). What it is doing, and I guess one can't fault ms word for doing this, it sees abcBAR as a chunk. Similarly(And more clearly), if you have abcאאא
in RTL and you replace it with FOO^&BAR
then it replaces it with abcBARאאאFOO
because the end if where the abc is and the end of the abc is after the 'c', so it sticks the BAR there. I will consider what to do re this, but that's what's happening. Maybe there's some kind of null hebrew character or right to left character that I can put after 'c' that will 'fix' this so I can wrap FOO..BAR around it.
FOO^&BAR
. I guess that you will get “RABאאאFOOabcd”, but I don’t know — it might be “BARאאאFOOabcd”. Either way, it’s sort-of doing what you asked — putting “FOO” before the “abcd” and putting “BAR” after the “אאא”. Seeing which one it does might be educational. P.S. What are you expecting to get? Something that looks like “FOOאאאabcdBAR”? What character sequence are you hoping to get that will look like that?FOO^&BAR
) that it might be"BARאאאFOOabcd"
It is. But I don't see how that helps in troubleshooting - if anything, that complicates it a little bit. I don't mind what string it puts on the left and what string it puts on the right. And as you see, It doesn't change the order of letters, so FOO remains FOO, אבג would remain אבג and BAR remains BAR, and I wouldn't want it to change the order of the letters.