Examples of bidirectional IRIs

Please view with a browser that does bidirectional rendering correctly!

Please view with a browser that correctly uses nominal digit shapes!

Legends

LTR: left-to-right; RTL: right-to-left; legends are also available as title popups.

  1. Logical Hebrew (displayed using LTR override)
  2. Visual Hebrew in LTR context
  3. Visual Hebrew in calculated LTR context (displayed using LTR override; should match green b)
  4. ASCII notation (upper case is Hebrew)
  5. ASCII notation (logical)
  6. ASCII notation (upper case is Arabic)
  7. Visual Arabic in LTR context
  8. Visual Arabic in calculated LTR context (displayed using LTR override; should match green g)
  9. Logical Arabic (displayed using LTR override)
  10. Visual Arabic in RTL context
  11. Visual Hebrew in RTL context

Example 1

A single component with rtl characters is inverted. Components can be read one by one, and each component can be read in its natural direction.

  1. http://ab.גדהוזח.ij/kl/mn/op.html
  2. http://ab.גדהוזח.ij/kl/mn/op.html
  3. http://ab.חזוהדג.ij/kl/mn/op.html
  4. http://ab.HGFEDC.ij/kl/mn/op.html
  5. http://ab.CDEFGH.ij/kl/mn/op.html
  6. http://ab.HGFEDC.ij/kl/mn/op.html
  7. http://ab.تثجحخد.ij/kl/mn/op.html
  8. http://ab.دخحجثت.ij/kl/mn/op.html
  9. http://ab.تثجحخد.ij/kl/mn/op.html
  10. http://ab.تثجحخد.ij/kl/mn/op.html
  11. http://ab.גדהוזח.ij/kl/mn/op.html

Example 2

More than one consecutive component with rtl characters is inverted as a whole. A sequence of rtl components is read rtl, in the same way as a sequence of rtl words is read rtl in a bidi text.

  1. http://ab.גדה.וזח/ij/kl/mn/op.html
  2. http://ab.גדה.וזח/ij/kl/mn/op.html
  3. http://ab.חזו.הדג/ij/kl/mn/op.html
  4. http://ab.HGF.EDC/ij/kl/mn/op.html
  5. http://ab.CDE.FGH/ij/kl/mn/op.html
  6. http://ab.HGF.EDC/ij/kl/mn/op.html
  7. http://ab.تثج.حخد/ij/kl/mn/op.html
  8. http://ab.دخح.جثت/ij/kl/mn/op.html
  9. http://ab.تثج.حخد/ij/kl/mn/op.html
  10. http://ab.تثج.حخد/ij/kl/mn/op.html
  11. http://ab.גדה.וזח/ij/kl/mn/op.html

Example 3

All components of an IRI (except for the scheme) are rtl. All rtl components are inverted overall. The whole IRI (except the scheme) is read rtl. Delimiters between rtl components stay between the respective components; delimiters between ltr and rtl components don't move.

  1. http://אב.גד.הו/זח/טי/כל?מן=סע;פץ=קר#שת
  2. http://אב.גד.הו/זח/טי/כל?מן=סע;פץ=קר#שת
  3. http://תש#רק=ץפ;עס=ןמ?לכ/יט/חז/וה.דג.בא
  4. http://VU#TS=RQ;PO=NM?LK/JI/HG/FE.DC.BA
  5. http://AB.CD.EF/GH/IJ/KL?MN=OP;QR=ST#UV
  6. http://VU#TS=RQ;PO=NM?LK/JI/HG/FE.DC.BA
  7. http://اب.تث.جح/خد/ذر/زس?شص=ضط;ظع=غف#قك
  8. http://كق#فغ=عظ;طض=صش?سز/رذ/دخ/حج.ثت.با
  9. http://اب.تث.جح/خد/ذر/زس?شص=ضط;ظع=غف#قك
  10. http://اب.تث.جح/خد/ذر/زس?شص=ضط;ظع=غف#قك
  11. http://אב.גד.הו/זח/טי/כל?מן=סע;פץ=קר#שת

Example 4

Each of several sequences of rtl components is inverted on its own. Each sequence of rtl components is read rtl, in the same way as each sequence of rtl words in an ltr text is read rtl.

  1. http://אב.גד.ef/gh/טי/כל.html
  2. http://אב.גד.ef/gh/טי/כל.html
  3. http://דג.בא.ef/gh/לכ/יט.html
  4. http://DC.BA.ef/gh/LK/JI.html
  5. http://AB.CD.ef/gh/IJ/KL.html
  6. http://DC.BA.ef/gh/LK/JI.html
  7. http://اب.تث.ef/gh/ذر/زس.html
  8. http://ثت.با.ef/gh/سز/رذ.html
  9. http://اب.تث.ef/gh/ذر/زس.html
  10. http://اب.تث.ef/gh/ذر/زس.html
  11. http://אב.גד.ef/gh/טי/כל.html

Example 5

Example 2, applied to components of different kinds. The inversion of the domain name label and the path component may be unexpected, but it is consistent with other bidi behavior. For reassurance that the domain component really is "ab.cd.EF", it may be helpful to read aloud the visual representation following the bidi algorithm. After "http://ab.cd." one reads the RTL block "E-F-slash-G-H", which corresponds to the logical representation.

  1. http://ab.cd.הו/זח/ij/kl.html
  2. http://ab.cd.הו/זח/ij/kl.html
  3. http://ab.cd.חז/וה/ij/kl.html
  4. http://ab.cd.HG/FE/ij/kl.html
  5. http://ab.cd.EF/GH/ij/kl.html
  6. http://ab.cd.HG/FE/ij/kl.html
  7. http://ab.cd.جح/خد/ij/kl.html
  8. http://ab.cd.دخ/حج/ij/kl.html
  9. http://ab.cd.جح/خد/ij/kl.html
  10. http://ab.cd.جح/خد/ij/kl.html
  11. http://ab.cd.הו/זח/ij/kl.html

Example 6

Same as Example 5, with more rtl components.The inversion of the domain name labels and the path components may be easier to identify because the delimiters also move.

  1. http://ab.גד.הו/זח/טי/kl.html
  2. http://ab.גד.הו/זח/טי/kl.html
  3. http://ab.יט/חז/וה.דג/kl.html
  4. http://ab.JI/HG/FE.DC/kl.html
  5. http://ab.CD.EF/GH/IJ/kl.html
  6. http://ab.JI/HG/FE.DC/kl.html
  7. http://ab.تث.جح/خد/ذر/kl.html
  8. http://ab.رذ/دخ/حج.ثت/kl.html
  9. http://ab.تث.جح/خد/ذر/kl.html
  10. http://ab.تث.جح/خد/ذر/kl.html
  11. http://ab.גד.הו/זח/טי/kl.html

Example 7

A single rtl component includes digits. Numbers are written ltr in all cases but are treated as an additional embedding inside a run of rtl characters. This is completely consistent with usual bidirectional text.

  1. http://ab.גדה123וזח.ij/kl/mn/op.html
  2. http://ab.גדה123וזח.ij/kl/mn/op.html
  3. http://ab.חזו123הדג.ij/kl/mn/op.html
  4. http://ab.HGF123EDC.ij/kl/mn/op.html
  5. http://ab.CDE123FGH.ij/kl/mn/op.html
  6. http://ab.HGF123EDC.ij/kl/mn/op.html
  7. http://ab.تثج123حخد.ij/kl/mn/op.html
  8. http://ab.دخح123جثت.ij/kl/mn/op.html
  9. http://ab.تثج123حخد.ij/kl/mn/op.html
  10. http://ab.تثج123حخد.ij/kl/mn/op.html
  11. http://ab.גדה123וזח.ij/kl/mn/op.html

Example 8

Not allowed!Numbers are at the start or end of an rtl component.The sequence "1/2" is interpreted by the bidi algorithm as a fraction, fragmenting the components and leading to confusion. There are other characters that are interpreted in a special way close to numbers; in particular, "+", "-", "#", "$", "%", ",", ".", and ":".

  1. http://ab.cd.ef/זח1/2טי/כל.html
  2. http://ab.cd.ef/זח1/2טי/כל.html
  3. http://ab.cd.ef/לכ/יט1/2חז.html
  4. http://ab.cd.ef/LK/JI1/2HG.html
  5. http://ab.cd.ef/GH1/2IJ/KL.html
  6. http://ab.cd.ef/LK/JI1/2HG.html
  7. http://ab.cd.ef/خد1/2ذر/زس.html
  8. http://ab.cd.ef/سز/رذ1/2دخ.html
  9. http://ab.cd.ef/خد1/2ذر/زس.html
  10. http://ab.cd.ef/خد1/2ذر/زس.html
  11. http://ab.cd.ef/זח1/2טי/כל.html

Example 9

Not allowed!The numbers in the previous example are percent-encoded.

  1. http://ab.cd.ef/זח%31/%32טי/כל.html
  2. http://ab.cd.ef/זח%31/%32טי/כל.html
  3. http://ab.cd.ef/לכ/יט%32/%31חז.html
  4. http://ab.cd.ef/LK/JI%32/%31HG.html
  5. http://ab.cd.ef/GH%31/%32IJ/KL.html
  6. http://ab.cd.ef/LK/JI32%/31%HG.html
  7. http://ab.cd.ef/خد%31/%32ذر/زس.html
  8. http://ab.cd.ef/سز/رذ32%/31%دخ.html
  9. http://ab.cd.ef/خد%31/%32ذر/زس.html
  10. http://ab.cd.ef/خد%31/%32ذر/زس.html
  11. http://ab.cd.ef/זח%31/%32טי/כל.html

Example 10

Allowed but not recommended! Components consisting of only numbers are allowed (it would be rather difficult to prohibit them), but these may interact with adjacent RTL components in ways that are not easy to predict.

  1. http://ab.גדהוזח.123/kl/mn/op.html
  2. http://ab.גדהוזח.123/kl/mn/op.html
  3. http://ab.123.חזוהדג/kl/mn/op.html
  4. http://ab.123.HGFEDC/kl/mn/op.html
  5. http://ab.CDEFGH.123/kl/mn/op.html
  6. http://ab.123.HGFEDC/kl/mn/op.html
  7. http://ab.تثجحخد.123/kl/mn/op.html
  8. http://ab.123.دخحجثت/kl/mn/op.html
  9. http://ab.تثجحخد.123/kl/mn/op.html
  10. http://ab.تثجحخد.123/kl/mn/op.html
  11. http://ab.גדהוזח.123/kl/mn/op.html

Example 11

Allowed but not recommended! Components consisting of numbers and left-to-right characters are allowed, but these may interact with adjacent RTL components in ways that are not easy to predict.

  1. http://ab.גדהוזח.123ij/kl/mn/op.html
  2. http://ab.גדהוזח.123ij/kl/mn/op.html
  3. http://ab.123.חזוהדגij/kl/mn/op.html
  4. http://ab.123.HGFEDCij/kl/mn/op.html
  5. http://ab.CDEFGH.123ij/kl/mn/op.html
  6. http://ab.123.HGFEDCij/kl/mn/op.html
  7. http://ab.تثجحخد.123ij/kl/mn/op.html
  8. http://ab.123.دخحجثتij/kl/mn/op.html
  9. http://ab.تثجحخد.123ij/kl/mn/op.html
  10. http://ab.تثجحخد.123ij/kl/mn/op.html
  11. http://ab.גדהוזח.123ij/kl/mn/op.html

Version: $Id: BidiExamples.html,v 1.11 2008/03/07 08:40:27 duerst Exp $

Questions? [email protected]

Copyright   © 1997 - 2002 W3C ( MIT , INRIA , Keio ), All Rights Reserved. W3C liability, trademark , document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.