<p><a name=bidi>The <strong class=html>BDO</strong> element <em>overrides the bidirectional algorithm</em> for the enclosed text.</a> Characters in <a href="http://www.unicode.org/">Unicode</a> are assigned a directionality, left-to-right or right-to-left, to allow the text to be rendered properly. For example, while English characters are presented left-to-right, Hebrew characters are presented right-to-left.</p>
<p>Unicode defines a <dfn>bidirectional algorithm</dfn> that must be applied whenever a document contains right-to-left characters. While this algorithm usually gives the proper presentation, occasionally authors must override the bidirectional algorithm and specify the directionality of the text. One such case is when Hebrew characters are stored in <em>visual order</em>, where the first character of a word is after the second character. Unicode assumes that the characters are stored in <em>logical order</em>, where the first character of a word is before the second character, so the bidirectional algorithm would result in a rendering with the first character incorrectly to the <em>left</em> of the second character.</p>
<p>The <strong class=html>BDO</strong> element requires the <strong class=html><a href="../attrs.html#dir">DIR</a></strong> attribute to specify the directionality of the enclosed text. If a document contains Hebrew characters stored in visual order, one should use <strong class=html><BDO DIR=ltr><var>text</var></BDO></strong> to force the proper presentation for that text.</p>
<p>Authors may alternatively override the bidirectional algorithm using the Unicode character <strong class=html>‭</strong> to force left-to-right directionality or <strong class=html>‮</strong> to force right-to-left directionality. The character <strong class=html>‬</strong> ends the overriding of the algorithm. These characters should not be used in combination with the <strong class=html><a href="../attrs.html#dir">DIR</a></strong> attribute.</p>
<h2>More Information</h2>
<ul>
<li><a href="http://www.w3.org/TR/REC-html40/struct/dirlang.html#edef-BDO">BDO in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá4.0 Recommendation</a></li>
<li><a href="http://www.w3.org/TR/REC-html40/struct/dirlang.html#h-8.2.1">Introduction to the bidirectional algorithm</a></li>