View file File name : jed020.html Content :<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="generator" content="hevea 2.35"> <link rel="stylesheet" type="text/css" href="jed.css"> <title>Eight Bit Clean Issues</title> </head> <body > <a href="jed019.html"><img src="previous_motif.svg" alt="Previous"></a> <a href="index.html"><img src="contents_motif.svg" alt="Up"></a> <a href="jed021.html"><img src="next_motif.svg" alt="Next"></a> <hr> <h2 id="sec41" class="section">19 Eight Bit Clean Issues</h2> <h3 id="sec42" class="subsection">19.1 Displaying Characters with the High Bit Set</h3> <p>There are several issues to consider here. The most important issue is how to get <span style="font-weight:bold">jed</span> to display 8 bit characters in a “clean” way. By “clean” I mean any character with the high bit set is sent to the display device as is. This is achieved by putting the line:</p><pre class="verbatim"> DISPLAY_EIGHT_BIT = 1; </pre><p>in the <code class="verb">jed.rc</code> (<code class="verb">.jedrc</code>) startup file. European systems might want to put this in the file <code class="verb">site.sl</code> for all users. The default is 1 so unless its value has been changed, this step may not be necessary.</p><p>There is another issue. Suppose you want to display 8 bit characters with extended Ascii codes greater than or equal to some value, say 160. This is done by putting <code class="verb">DISPLAY_EIGHT_BIT = 160;</code>. I believe that ISO Latin character sets assume this. This is the default value for Unix and VMS systems.</p> <h3 id="sec43" class="subsection">19.2 Inputting Characters with the hight bit Set</h3> <p> Inputting characters with the high bit set into <span style="font-weight:bold">jed</span> is another issue. How <span style="font-weight:bold">jed</span> interprets this bit is controlled by the variable <code class="verb">META_CHAR</code>. What happens is this: When <span style="font-weight:bold">jed</span> reads a character from the input device with the high bit set, it: </p><ol class="enumerate" type=1><li class="li-enumerate"> Checks the value of <code class="verb">META_CHAR</code>. If this value is -1, <span style="font-weight:bold">jed</span> simply inserts the character into the buffer.</li><li class="li-enumerate">For any other value of <code class="verb">META_CHAR</code> in the range 0 to 255, <span style="font-weight:bold">jed</span> returns two 7-bit characters. The first character returned is <code class="verb">META_CHAR</code> itself. The next character returned is the original character but with the high bit stripped. </li></ol><p>The default value of <code class="verb">META_CHAR</code> is -1 which means that when <span style="font-weight:bold">jed</span> sees a character with the high bit set, <span style="font-weight:bold">jed</span> leaves it as is. Please note that a character with the high bit set it <em>cannot</em> be the prefix character of a keymap. It can be a part of the keymap but not the prefix.</p><p>Some systems only handle 7-bit character sequences and as a result, <span style="font-weight:bold">jed</span> will only see 7-bit characters. <span style="font-weight:bold">jed</span> is still able to insert <em>any</em> character in the range 0-255 on a 7-bit system. This is done through the use of the <code class="verb">quoted_insert</code> function which, by default, is bound to the backquote key <span style="font-family:monospace">‘</span>. If the <code class="verb">quoted_insert</code> function is called with a digit argument (repeat argument), the character with the value of the argument is inserted into the buffer. Operationally, one hits <span style="font-variant:small-caps">Esc</span>, enters the extended Ascii code and hits the backquote key. For example, to insert character 255 into the buffer, simply press the following five keys: <span style="font-variant:small-caps">Esc 2 5 5 ‘</span>.</p> <h3 id="sec44" class="subsection">19.3 Upper Case - Lower Case Conversions</h3> <p>The above discussion centers around input and output of characters with the high bit set. How <span style="font-weight:bold">jed</span> treats them internally is another issue and new questions arise. For example, what is the uppercase equivalent of a character with ASCII code 231? This may vary from language to language. Some languages even have characters whose uppercase equivalent correspond to multiple characters. For <span style="font-weight:bold">jed</span>, the following assumptions have been made: </p><ul class="itemize"><li class="li-itemize"> Each character is only 8 bits. </li><li class="li-itemize">Each character has a unique uppercase equivalent. </li><li class="li-itemize">Each character has a unique lowercase equivalent. </li></ul><p> It would be nice if a fourth assumption could be made: </p><ul class="itemize"><li class="li-itemize"> The value of the lowercase of a character is greater than or equal to its uppercase counterpart. </li></ul><p> However, apparently this is not possible since most IBMPC character sets violate this assumption. Hence, <span style="font-weight:bold">jed</span> does not assume it. Suppose <span style="font-family:monospace">X</span> is the upper case value of some character and suppose <span style="font-family:monospace">Y</span> is its lower case value. Then to make <span style="font-weight:bold">jed</span> aware of this fact and use it case conversions, it may be necessary to put a statement of the form: </p><pre class="verbatim"> define_case (X, Y); </pre><p> in the startup file. For example, suppose 211 is the uppercase of 244. Then, the line </p><pre class="verbatim"> define_case (211, 244); </pre><p> will make <span style="font-weight:bold">jed</span> use this fact in operations involving the case of a character.</p><p>This has already been done for the ISO Latin 1 character set. See the file <code class="verb">iso-latin.sl</code> for details. For MSDOS, this will not work. Instead use the files <code class="verb">dos437.sl</code> and <code class="verb">dos850.sl</code>. By default, <span style="font-weight:bold">jed</span>’s internal lookup tables are initialized to the ISO Latin set for Unix and VMS systems and to the DOS 437 code page for the IBMPC. To change the defaults, it is only necessary to load the appropriate file. For example, to load <code class="verb">dos850.sl</code> definitions, put </p><pre class="verbatim"> evalfile ("dos850"); pop (); </pre><p> in the startup file (e.g., <code class="verb">site.sl</code>). In addition to uppercase/lowercase information, these files also contain word definitions, i.e., which characters constitute a “word”.</p> <hr> <a href="jed019.html"><img src="previous_motif.svg" alt="Previous"></a> <a href="index.html"><img src="contents_motif.svg" alt="Up"></a> <a href="jed021.html"><img src="next_motif.svg" alt="Next"></a> </body> </html>