Warning: file_get_contents(): open_basedir restriction in effect. File(/proc/loadavg) is not within the allowed path(s): (/home:/tmp:/usr) in /home/ccomm/public_html/lmjs/pmwiki/local/config.php on line 501

Warning: file_get_contents(/proc/loadavg): failed to open stream: Operation not permitted in /home/ccomm/public_html/lmjs/pmwiki/local/config.php on line 501

Warning: Cannot modify header information - headers already sent by (output started at /home/ccomm/public_html/lmjs/pmwiki/local/config.php:501) in /home/ccomm/public_html/lmjs/pmwiki/cookbook/detect_mobile.php on line 110

Warning: Cannot modify header information - headers already sent by (output started at /home/ccomm/public_html/lmjs/pmwiki/local/config.php:501) in /home/ccomm/public_html/lmjs/pmwiki/cookbook/detect_mobile.php on line 111

Warning: Cannot modify header information - headers already sent by (output started at /home/ccomm/public_html/lmjs/pmwiki/local/config.php:501) in /home/ccomm/public_html/lmjs/pmwiki/pmwiki.php on line 1254
[--Lamed Messianic Jewish Studies--] Main/Unicode LRM and RLM: Mark-Up Explanation

Unicode LRM and RLM: Mark-Up Explanation

First, A Note About Wiki Usage of Right-to-Left-Mark

The PmWiki project environment takes into account the use of hidden RLM (Right-to-Left Mark-Up, or RTL). As well, most browsers today are standards-compliant and will render the syntax used with the appropriate display. In order to increase cross-browser compatibility on this site, special Web-Font Kits have been included that make use of character mapping by simply surrounding the character maps used with the appropriate css-class tags for the desired kit to be utilized.

The notes below pertain to HTML examples only to give an insight to the way the code works under the user interface as it is translated directly from the code syntax which is produced on the fly from the PHP Wiki environment.

UniCode and Prescribed Usage of Right-to-Left-Mark

In Unicode, the RLM character is encoded at U+200F RIGHT-TO-LEFT MARK (HTML ‏ · ‏).
In UTF-8 (Wikipedia:UTF-8) it is E2 80 8F.

In Unicode, the LRM character is encoded at U+200E LEFT-TO-RIGHT MARK (HTML ‎ · ‎).
In UTF-8 (Wikipedia:UTF-8) it is E2 80 8E.

Usage is prescribed in the Unicode Bidirectional Algorithm. Also See: Universal Character Set and W3.org: UBA Basics.

Example of Right-to-Left-Mark use in HTML

Suppose the writer wishes to inject a run of Arabic or Hebrew (i.e. right-to-left) text into an English paragraph, with an exclamation point at the end of the run on the left hand side. "I enjoyed staying -- really! -- at his house." With the "really!" in Hebrew renders as follows:

Syntax: I enjoyed staying -- rtl-text<span style="color:red">!</span> -- at his house.
Example: I enjoyed staying -- באמת! -- at his house.
(Note that in a computer's memory, the order of the Hebrew characters is ‎ב‎,‎א‎,‎מ‎,‎ת‎.)
Syntax: &lrm;ב&lrm;,&lrm;א&lrm;,&lrm;מ&lrm;,&lrm;ת&lrm;

With an RLM added after the exclamation mark, it renders as follows:

Syntax: I enjoyed staying -- rtl-text<span style="color:red">!</span>&rlm; -- at his house.
Example: I enjoyed staying -- באמת!‏ -- at his house.

(Standards-compliant browsers will render the exclamation mark on the right in the first example, and on the left in the second.)

This happens because the browser recognizes that the paragraph is in a LTR script (Latin), and applies punctuation, which is neutral as to its direction, in coordination with the surrounding (left-to-right) text. The RLM causes the punctuation to be surrounded by only RTL text - the Hebrew and the RLM - and hence be positioned as if it were in right-to-left text, i.e., to the left of the preceding text.

Example of Left-to-Right-Mark use in HTML

Suppose the writer wishes to use some English text (a left-to-right text) into a paragraph written in Arabic or Hebrew (a right-to-left text) with non-alphabetic characters to the right of the English text.

For example, the writer wants to translate, "The language C++ is a programming language used..." into Arabic.

Without an LRM control character, the result looks like this:
Syntax: <span dir="rtl">rtl-text<span style="color:red">ltr-text</span>rlt-text</span>
Example: لغة C++ هي لغة برمجة تستخدم...

With an LRM entered in the HTML after the ++, it looks like this, as the writer intends:
Syntax: <span dir="rtl">rtl-text<span style="color:red">ltr-text</span>&lrm; rtl-text</span>
Example: لغة C++‎ هي لغة برمجة تستخدم...

In the first example, without an LRM control character, a web browser will render the ++ on the left of the "C" because the browser recognizes that the paragraph is in a right-to-left text (Arabic) and applies punctuation, which is neutral as to its direction, according to the direction of the adjacent text. The LRM control character causes the punctuation to be adjacent to only left-to-right text – the "C" and the LRM – and position as if it were in left-to-right text, i.e., to the right of the preceding text.

Some software requires using the HTML code &amp;#8206; or &amp;lrm; instead of the invisible Unicode control character itself. Using the invisible control character directly could also make copy editing difficult.