On Thu, 2017-06-29 at 10:51 -0700, Kerim Aydin wrote:
> ais523 wrote:
> > Saying "A byte stream containing Arabic text must be interpreted as
> > though it were laid out left to right" would be in its own right
> > disrespectful to the language, because that's not how Arabic is written
> > in practice. 
> 
> So, the crux of it.  A couple thoughts.  I am a very rudimentary Arabic 
> speaker,
> learning from a couple books and reading street signs.  I've never typed it.
> I cut and paste it from Google translate.  Now, when I did the cut/paste, I
> wondered "would it paste into my editor in the opposite direction, or what?"
> 
> Imagine my surprise, when pasted, that, WHEN MY CURSOR WAS IN THE ARABIC TEXT,
> MY CONTROL KEYS WORKED BACKWARDS.  Backspace deleted to the right, and typing
> spaces and language-neutral punctuation moved the cursor right to left.  When
> I moved the cursor into the Latin text, it went back to what I was used to.  
> I thought "what wizardry is this??"  And I thought "these computer programmers
> (like you) who do these things are $%$%&$* brilliant!"  
> 
> But my other thought was, "hey, it just works".  It truly meant, that for an
> "Arabic writer", both the entry and the reading could naturally start from the
> right (then end in a gobbledigook reversed latin set of characters) just as 
> the
> English starts out correctly, then ends in reversed Arabic.  I don't know if
> this works for all email clients, but it was even preserved through emailing -
> I could reply to my Arabic message and get the same thing.  It's not perfect,
> e.g. line breaks, but for a single sentence on a single line - it just works,
> naturally, regardless of which language you thought you were typing.
> 
> So while I don't have any native Arabic speakers handy today, and line breaks
> are still a problem, I can look at that single line of text and think:  each
> part was entered/typed in the "correct" order for each language, as it truly
> was, and would be read that way by respective speakers of the languages.
> 
> So I wonder, as brilliant as the computer programming is that does this, is
> taking the programming view and breaking it down into the underlying bytes
> missing the forest for the trees?  You, or someone like you, created something
> that works for someone like me... why decompile?

Well, the point is that the text contains information about the full
order of all the text in it. If you press Home, you go to the logical
"start" of the line, regardless of whether that's in English or Arabic
(thus it might be the left or the right end). If you press End, you go
to the logical "end" of the line. In this particular line, the start is
in the English, and the end is in the Arabic; it could easily have been
written the other way round and look the same. This information isn't
preserved by accident, either; it's necessary to make the editing work
(i.e. where backspace deletes "back" whether that happens to be right
or left in this particular language), and it's needed to render the
text correctly. As a concrete example, the information is needed to
know whether the colon in the middle is after the English and before
the Arabic (in which case backspace when the cursor is near the colon
should delete it to the left), or whether it's before the English and
after the Arabic (in which case backspace when the cursor is near the
colon should delete it to the right). Each of these two cursor
behaviours gives a particular unambiguous meaning to the sentence in
question.

I admit to somewhat missing the forest for the trees in my judgement. I
(perhaps incorrectly) assumed that all this was common knowledge,
especially for people who used both Arabic and a left-to-right language
on computers, and looked at the bytes underlying the email to see what
they said about the logical order of the text they represented; it was
a fairly interesting legal point because the standards defining the
encoding in question are unclear, and thus I had to run through the
possibilities. I don't think I was as clear as I could have been about
why I was doing that, though.

-- 
ais523

Reply via email to