Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 46 -- Right to left intervals



>>>>> "MH" == Michel Hack <mhack@xxxxxxx> writes:

MH> I seem to recall that small integers (year numbers, page numbers)
MH> are presented in the same direction as in Latin scripts (high-order
MH> digit on the left), which means that they need to be written
MH> least-significant-digit-first into a string.

The unicode bidi algorithm specifies that the logical order of strings
of digits is big endian and the screen order is l2r, notwithstanding the
direction of surrounding text.

I do not know how that compares to how r2l handwriting is taught, but
almost everything uses unicode's bidi algo these days, so 1788 will need
to take unicode bidi into account if it wants to be bidi aware.

So, a printf(3) string containing some ascii digits embedded in a r2l
script, when output to something which knows the bidi algorithm, will
show the digits l2r within the otherwise r2l text.

You can use the fribidi(1) cli application to experiment.

Or just compare the display of:

   http://ar.wikipedia.org

vs the raw html text.

In particular:

  :; curl -sL http://ar.wikipedia.org|grep footer-info-lastmod | tr -d \\t

shows a good example of that, if you run curl in a terminal emulator
which does not re-order bidi text for display, but does support utf-8
and uses a font with support for Arabic.

Compare the line output by that, with the same when piped thru fribidi.

-JimC
-- 
James Cloos <cloos@xxxxxxxxxxx>         OpenPGP: 1024D/ED7DAEA6