<?xml version='1.0' encoding='ISO-8859-1' standalone='no'?>
<!DOCTYPE interface-description SYSTEM 'file:///usr/pkgsrc/lang/oo2c/work.macaroon/oo2c_32-2.0.11/rsrc/OOC/xml/interface-description.dtd'>
<interface-description name='XML:UnicodeCodec' id=''>
  <const-decl name='decodeError' id='decodeError' export='yes' value='unknown'>
    <oberon-doc>
      <summary>This character is used to replace incoming characters whose value is unknown or unrepresentable in Unicode.</summary>
      <p pad-after='yes' no-indent='yes'>This character is used to replace incoming characters whose value is unknown or unrepresentable in Unicode.  This character is assigned the Unicode name "REPLACEMENT CHARACTER".</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='encodeError' id='encodeError' export='yes' value='unknown'>
    <oberon-doc>
      <summary>This character is used to replace outgoing characters whose value cannot be represented by the used encoding scheme.</summary>
      <p pad-after='yes' no-indent='yes'>This character is used to replace outgoing characters whose value cannot be represented by the used encoding scheme.  It is assumed, that all character encodings know the question mark character (Unicode Ux003F).</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='byteOrderMark' id='byteOrderMark' export='yes' value='unknown'>
    <oberon-doc>
      <summary>The Unicode byte order mark.</summary>
      <p pad-after='yes' no-indent='yes'>The Unicode byte order mark.  Also known as <samp>ZERO WIDTH NO-BREAK SPACE</samp>.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='bomNotApplicable' id='bomNotApplicable' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Byte order markers are not applicable to the encoding.</summary>
      <p pad-after='yes' no-indent='yes'>Byte order markers are not applicable to the encoding.  This is the case if the encoding</p>
      <itemize pad-after='yes'>
        <itemize-mark><bullet/></itemize-mark>
        <item pad-after='yes'>
          <p pad-after='no' no-indent='yes'>maps all characters to single bytes (like <samp>US-ASCII</samp> or <samp>ISO-8859-1</samp>),</p>
        </item>
        <item pad-after='yes'>
          <p pad-after='no' no-indent='yes'>is byte order independent (like <samp>UTF-8</samp>), or</p>
        </item>
        <item pad-after='no'>
          <p pad-after='no' no-indent='yes'>defines the byte order explicitly and <emph>requires</emph> that the document does not start with a byte order mark (like <samp>UTF-16LE</samp> and <samp>UTF-16BE</samp>).</p>
        </item>
      </itemize>
      <p pad-after='yes' no-indent='no'>All instances of UxFEFF are passed to the application, regardless of their position in the document.  Therefore, if a document using such an encoding begins with UxFEFF, this character is reported to the application as <samp>ZERO WIDTH NO-BREAK SPACE</samp>.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='bomOptional' id='bomOptional' export='yes' value='unknown'>
    <oberon-doc>
      <summary>A document using this encoding <emph>may</emph> begin with a byte order mark.</summary>
      <p pad-after='yes' no-indent='yes'>A document using this encoding <emph>may</emph> begin with a byte order mark.  Without a byte order mark, a encoding specific default byte order is assumed.  An example is <samp>UTF-16</samp>, which defaults to big endian byte order in the absence of a byte order mark.  If a document begins with a byte order mark, then this first character should not be reported to the application.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='bomRequired' id='bomRequired' export='yes' value='unknown'>
    <oberon-doc>
      <summary>The encoding requires that the document begins with a byte order mark.</summary>
      <p pad-after='yes' no-indent='yes'>The encoding requires that the document begins with a byte order mark.  The BOM should not be passed to the application.  Currently, no codec implementation uses this variant.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='maxUTF8EncodingLength' id='maxUTF8EncodingLength' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Maximum length of the character encodings of all possible UCS-4 (<emph>not</emph> just Unicode!) characters, for all known encodings.</summary>
      <p pad-after='yes' no-indent='yes'>Maximum length of the character encodings of all possible UCS-4 (<emph>not</emph> just Unicode!) characters, for all known encodings.  Currently, the longest encoding in UTF-8 needs 6 bytes.</p>
    </oberon-doc>
  </const-decl>
  <const-decl name='maxUCS2EncodingLength' id='maxUCS2EncodingLength' export='yes' value='unknown'>
    <oberon-doc>
      <summary>Maximum length of any UCS-4 character, encoded with Unicode codes.</summary>
      <p pad-after='yes' no-indent='yes'>Maximum length of any UCS-4 character, encoded with Unicode codes.  In the worst case, a pair of high and low surrogate codes must be used.</p>
    </oberon-doc>
  </const-decl>
  <procedure name='Register' id='Register' export='yes'>
    <formal-parameters>
      <parameter-decl name='name' id='Register.name' export='no' variable-parameter='no'>
        <type>
          <array>
            <element-type>
              <type-name module='#predef' name='CHAR'/>
            </element-type>
          </array>
        </type>
      </parameter-decl>
      <parameter-decl name='factory' id='Register.factory' export='no' variable-parameter='no'>
        <type>
          <type-name name='Factory' href='#Factory'/>
        </type>
      </parameter-decl>
    </formal-parameters>
  </procedure>
  <procedure name='Unregister' id='Unregister' export='yes'>
    <formal-parameters>
      <parameter-decl name='name' id='Unregister.name' export='no' variable-parameter='no'>
        <type>
          <array>
            <element-type>
              <type-name module='#predef' name='CHAR'/>
            </element-type>
          </array>
        </type>
      </parameter-decl>
    </formal-parameters>
  </procedure>
  <import-decl name='-RT0' id='-RT0' export='no' module='RT0'/>
  <import-decl name='-Object' id='-Object' export='no' module='Object'/>
  <import-decl name='-Exception' id='-Exception' export='no' module='Exception'/>
  <class name='Factory'>
    <type-decl name='Factory' id='Factory' export='yes'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='FactoryDesc' href='#FactoryDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='FactoryDesc' id='FactoryDesc' export='yes'>
      <type>
        <record>
          <field-decl name='bom' id='FactoryDesc.bom' export='read-only'>
            <oberon-doc>
              <summary>This flag describes how the generated codes deal with byte order markers.</summary>
              <p pad-after='yes' no-indent='yes'>This flag describes how the generated codes deal with byte order markers.  It can be one of <oberon-const href='#bomNotApplicable'>bomNotApplicable</oberon-const>, <oberon-const href='#bomOptional'>bomOptional</oberon-const>, or <oberon-const href='#bomRequired'>bomRequired</oberon-const>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='SHORTINT'/>
            </type>
          </field-decl>
        </record>
      </type>
    </type-decl>
    <procedure name='InitFactory' id='InitFactory' export='yes'>
      <oberon-doc>
        <summary>Initializes factory <oberon-param href='#InitFactory.f'>f</oberon-param> with the byte order characteristic <oberon-param href='#InitFactory.bom'>bom</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Initializes factory <oberon-param href='#InitFactory.f'>f</oberon-param> with the byte order characteristic <oberon-param href='#InitFactory.bom'>bom</oberon-param>.</p>
      </oberon-doc>
      <formal-parameters>
        <parameter-decl name='f' id='InitFactory.f' export='no' variable-parameter='no'>
          <type>
            <type-name name='Factory' href='#Factory'/>
          </type>
        </parameter-decl>
        <parameter-decl name='bom' id='InitFactory.bom' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='SHORTINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='NewCodec' id='FactoryDesc.NewCodec' export='yes'>
      <oberon-doc>
        <summary>Creates a new codec from factory <oberon-param href='#FactoryDesc.NewCodec.f'>f</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Creates a new codec from factory <oberon-param href='#FactoryDesc.NewCodec.f'>f</oberon-param>.  This should not be called for factories with an <oberon-field href='#FactoryDesc.bom'>Factory.bom</oberon-field> of <oberon-const href='#bomOptional'>bomOptional</oberon-const> or <oberon-const href='#bomRequired'>bomRequired</oberon-const>.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='f' id='FactoryDesc.NewCodec.f' export='no' variable-parameter='no'>
          <type>
            <type-name name='Factory' href='#Factory'/>
          </type>
        </receiver-decl>
        <result-type>
          <type-name name='Codec' href='#Codec'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='NewCodecBOM' id='FactoryDesc.NewCodecBOM' export='yes'>
      <oberon-doc>
        <summary>Creates a new codec from factoriy <oberon-param href='#FactoryDesc.NewCodecBOM.f'>f</oberon-param>, taking the byte order mark into account.</summary>
        <p pad-after='yes' no-indent='yes'>Creates a new codec from factoriy <oberon-param href='#FactoryDesc.NewCodecBOM.f'>f</oberon-param>, taking the byte order mark into account.  The exact behaviour of this procedure depends on the value of <oberon-field href='#FactoryDesc.bom'>f.bom</oberon-field>.</p>
        <table pad-after='yes'>
          <table-row pad-after='yes'>
            <table-first-column pad-after='no'><oberon-const href='#bomNotApplicable'>bomNotApplicable</oberon-const></table-first-column>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'>Any byte order mark is ignored, and <oberon-param href='#FactoryDesc.NewCodecBOM.sourceDone'>sourceDone</oberon-param> is set to <oberon-param href='#FactoryDesc.NewCodecBOM.sourceStart'>sourceStart</oberon-param>.</p>
            </item>
          </table-row>
          <table-row pad-after='yes'>
            <table-first-column pad-after='no'><oberon-const href='#bomOptional'>bomOptional</oberon-const></table-first-column>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'>If the <oberon-param href='#FactoryDesc.NewCodecBOM.source'>source</oberon-param> begins with a byte order mark, it is removed from the input and the correspondig codec is returned, and the parameter <oberon-param href='#FactoryDesc.NewCodecBOM.sourceDone'>sourceDone</oberon-param> is set after the end of the byte order mark.  If there is no byte order mark, <oberon-param href='#FactoryDesc.NewCodecBOM.sourceDone'>sourceDone</oberon-param> is set to <oberon-param href='#FactoryDesc.NewCodecBOM.sourceStart'>sourceStart</oberon-param> and the default codec is returned.</p>
            </item>
          </table-row>
          <table-row pad-after='no'>
            <table-first-column pad-after='no'><oberon-const href='#bomRequired'>bomRequired</oberon-const></table-first-column>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'>In the presence of a byte order mark, this is just like <oberon-const href='#bomOptional'>bomOptional</oberon-const>, but without a byter order mark the returned codec's <oberon-field href='#CodecDesc.invalidChars'>Codec.invalidChars</oberon-field> counter is set to one and <oberon-param href='#FactoryDesc.NewCodecBOM.sourceDone'>sourceDone</oberon-param> is set to <oberon-param href='#FactoryDesc.NewCodecBOM.sourceStart'>sourceStart</oberon-param>.</p>
            </item>
          </table-row>
        </table>
        <pre-cond pad-after='yes'>
          <p pad-after='no' no-indent='yes'><oberon-param href='#FactoryDesc.NewCodecBOM.sourceEnd'>sourceEnd</oberon-param>-<oberon-param href='#FactoryDesc.NewCodecBOM.sourceStart'>sourceStart</oberon-param> &gt;= <oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>, <strong>or</strong> <oberon-param href='#FactoryDesc.NewCodecBOM.sourceEnd'>sourceEnd</oberon-param> designates the end of the byte sequence being decoded.  This means, that at least one complete character is encoded in the input sequence, or the input sequence ends with a possibly incomplete character.</p>
        </pre-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='f' id='FactoryDesc.NewCodecBOM.f' export='no' variable-parameter='no'>
          <type>
            <type-name name='Factory' href='#Factory'/>
          </type>
        </receiver-decl>
        <parameter-decl name='source' id='FactoryDesc.NewCodecBOM.source' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceStart' id='FactoryDesc.NewCodecBOM.sourceStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceEnd' id='FactoryDesc.NewCodecBOM.sourceEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceDone' id='FactoryDesc.NewCodecBOM.sourceDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <result-type>
          <type-name name='Codec' href='#Codec'/>
        </result-type>
      </formal-parameters>
    </procedure>
    <procedure name='GetEncodingName' id='FactoryDesc.GetEncodingName' export='yes'>
      <oberon-doc>
        <summary>Returns the preferred MIME name for the factory's encoding.</summary>
        <p pad-after='yes' no-indent='yes'>Returns the preferred MIME name for the factory's encoding.</p>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='f' id='FactoryDesc.GetEncodingName.f' export='no' variable-parameter='no'>
          <type>
            <type-name name='Factory' href='#Factory'/>
          </type>
        </receiver-decl>
        <parameter-decl name='name' id='FactoryDesc.GetEncodingName.name' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='GetFactory' id='GetFactory' export='yes'>
      <formal-parameters>
        <parameter-decl name='name' id='GetFactory.name' export='no' variable-parameter='no'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <result-type>
          <type-name name='Factory' href='#Factory'/>
        </result-type>
      </formal-parameters>
    </procedure>
  </class>
  <class name='Codec'>
    <type-decl name='Codec' id='Codec' export='yes'>
      <type>
        <pointer>
          <pointer-base>
            <type-name name='CodecDesc' href='#CodecDesc'/>
          </pointer-base>
        </pointer>
      </type>
    </type-decl>
    <type-decl name='CodecDesc' id='CodecDesc' export='yes'>
      <type>
        <record>
          <field-decl name='invalidChars' id='CodecDesc.invalidChars' export='yes'>
            <type>
              <type-name module='#predef' name='LONGINT'/>
            </type>
          </field-decl>
          <field-decl name='bom' id='CodecDesc.bom' export='read-only'>
            <oberon-doc>
              <summary>This is a copy of the creating factory's <oberon-field href='#FactoryDesc.bom'>Factory.bom</oberon-field>.</summary>
              <p pad-after='yes' no-indent='yes'>This is a copy of the creating factory's <oberon-field href='#FactoryDesc.bom'>Factory.bom</oberon-field>.</p>
            </oberon-doc>
            <type>
              <type-name module='#predef' name='SHORTINT'/>
            </type>
          </field-decl>
        </record>
      </type>
    </type-decl>
    <procedure name='Init' id='Init' export='yes'>
      <formal-parameters>
        <parameter-decl name='codec' id='Init.codec' export='no' variable-parameter='no'>
          <type>
            <type-name name='Codec' href='#Codec'/>
          </type>
        </parameter-decl>
        <parameter-decl name='bom' id='Init.bom' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='SHORTINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='Decode' id='CodecDesc.Decode' export='yes'>
      <oberon-doc>
        <summary>Decodes the bytes in <samp><oberon-param href='#CodecDesc.Decode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>[</samp> into the Unicode sequence <samp><oberon-param href='#CodecDesc.Decode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>[</samp>.</summary>
        <p pad-after='yes' no-indent='yes'>Decodes the bytes in <samp><oberon-param href='#CodecDesc.Decode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>[</samp> into the Unicode sequence <samp><oberon-param href='#CodecDesc.Decode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>[</samp>.</p>
        <pre-cond pad-after='yes'>
          <itemize pad-after='no'>
            <itemize-mark><bullet/></itemize-mark>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>, and the character sequence <samp><oberon-param href='#CodecDesc.Decode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>[</samp> holds the characters that are to be decoded.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>-<oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param> &gt;= <oberon-const href='#maxUCS2EncodingLength'>maxUCS2EncodingLength</oberon-const>.  In other words, there must be enough room in the destination sequence <samp><oberon-param href='#CodecDesc.Decode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>[</samp> to hold at least one UCS-4 character, possibly split into a high and low surrogate pair.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param> is the value of <oberon-param href='#CodecDesc.Decode.sourceDone'>sourceDone</oberon-param> of a previous call to this procedure (or <oberon-proc href='#FactoryDesc.NewCodecBOM'>Factory.NewCodecBOM</oberon-proc>), <strong>or</strong> the address of <samp>source[sourceStart]</samp> is aligned on a 4-byte boundary.  This ensures, that the decoder functions can access the source sequence in chunks of 2 and 4 bytes, without needing to worry about the alignment of memory accesses.</p>
            </item>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>-<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param> &gt;= <oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>, <strong>or</strong> <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param> designates the end of the byte sequence being decoded.  This means, that at least one complete character is encoded in the input sequence, or the input sequence ends with a possibly incomplete character.</p>
            </item>
          </itemize>
        </pre-cond>
        <post-cond pad-after='yes'>
          <itemize pad-after='no'>
            <itemize-mark><bullet/></itemize-mark>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Decode.sourceDone'>sourceDone</oberon-param> &lt;= <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param> and <oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Decode.destDone'>destDone</oberon-param> &lt;= <oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>.  This means, that at least one character has been decoded.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Decode.sourceDone'>sourceDone</oberon-param> &gt; <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>-<oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const> <emph>or</emph> <oberon-param href='#CodecDesc.Decode.destDone'>destDone</oberon-param> &gt; <oberon-param href='#CodecDesc.Decode.destEnd'>destEnd</oberon-param>-<oberon-const href='#maxUCS2EncodingLength'>maxUCS2EncodingLength</oberon-const>.  This implies, that the decoding algorithm continues until it gets near the end of the source or destination buffer.  But the implementation of the decoding algorithm can be set up in such a way, that it stops when the input or output sequence of the next character <emph>may</emph> not fit into the buffers.  It must not decode the maximum number of bytes that fit into the buffers.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'>If the procedure was started with <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>-<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>, and if there is enough room in the destination buffer to store the whole result, then all remaining bytes in the source sequence have been decoded and <oberon-param href='#CodecDesc.Decode.sourceDone'>sourceDone</oberon-param> equals <oberon-param href='#CodecDesc.Decode.sourceEnd'>sourceEnd</oberon-param>.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'>Every malformed character, and every decoded character code that can not be mapped onto a Unicode character (i.e., one or two UCS-2 values), is replaced with <oberon-const href='#decodeError'>decodeError</oberon-const>, and the counter <oberon-field href='#CodecDesc.invalidChars'>codec.invalidChars</oberon-field> is incremented by one.  The output of the decoding function contains only valid characters.  That is, all surrogate codes are properly paired, and the character codes U+FFFE and U+FFFF are replaced with <oberon-const href='#decodeError'>decodeError</oberon-const>.</p>
            </item>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'><samp><oberon-param href='#CodecDesc.Decode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Decode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.destDone'>destDone</oberon-param>[</samp> holds the result of decoding <samp><oberon-param href='#CodecDesc.Decode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Decode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Decode.sourceDone'>sourceDone</oberon-param>[</samp>.</p>
            </item>
          </itemize>
        </post-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='codec' id='CodecDesc.Decode.codec' export='no' variable-parameter='no'>
          <type>
            <type-name name='Codec' href='#Codec'/>
          </type>
        </receiver-decl>
        <parameter-decl name='source' id='CodecDesc.Decode.source' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceStart' id='CodecDesc.Decode.sourceStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceEnd' id='CodecDesc.Decode.sourceEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='dest' id='CodecDesc.Decode.dest' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='LONGCHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='destStart' id='CodecDesc.Decode.destStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destEnd' id='CodecDesc.Decode.destEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceDone' id='CodecDesc.Decode.sourceDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destDone' id='CodecDesc.Decode.destDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='Encode' id='CodecDesc.Encode' export='yes'>
      <oberon-doc>
        <summary>Encodes the Unicode characters in <samp><oberon-param href='#CodecDesc.Encode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>[</samp> into the byte sequence <samp><oberon-param href='#CodecDesc.Encode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>[</samp>.</summary>
        <p pad-after='yes' no-indent='yes'>Encodes the Unicode characters in <samp><oberon-param href='#CodecDesc.Encode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>[</samp> into the byte sequence <samp><oberon-param href='#CodecDesc.Encode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>[</samp>.</p>
        <pre-cond pad-after='yes'>
          <itemize pad-after='no'>
            <itemize-mark><bullet/></itemize-mark>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>, and the Unicode character sequence <samp><oberon-param href='#CodecDesc.Encode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>[</samp> holds the characters that are to be decoded.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>-<oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param> &gt;= <oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>.  In other words, there must be enough room in the destination sequence <samp><oberon-param href='#CodecDesc.Encode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>[</samp> to hold at least one UCS-4 character, possibly encoded as a sequence of 6 bytes.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param> is the value of <oberon-param href='#CodecDesc.Encode.destDone'>destDone</oberon-param> of a previous call to this procedure (or <oberon-proc href='#FactoryDesc.NewCodecBOM'>Factory.NewCodecBOM</oberon-proc>), <strong>or</strong> the address of <samp>dest[destStart]</samp> is aligned on a 4-byte boundary.  This ensures, that the encoder functions can access the destination sequence in chunks of 2 and 4 bytes, without needing to worry about the alignment of memory accesses.</p>
            </item>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>-<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param> &gt;= <oberon-const href='#maxUCS2EncodingLength'>maxUCS2EncodingLength</oberon-const>, <strong>or</strong> <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param> designates the end of the character sequence being decoded.  This means, that at least one complete character is in the input sequence, or the input sequence ends with a possibly incomplete character.</p>
            </item>
          </itemize>
        </pre-cond>
        <post-cond pad-after='yes'>
          <itemize pad-after='no'>
            <itemize-mark><bullet/></itemize-mark>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Encode.sourceDone'>sourceDone</oberon-param> &lt;= <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param> and <oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param> &lt; <oberon-param href='#CodecDesc.Encode.destDone'>destDone</oberon-param> &lt;= <oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>.  This means, that at least one character has been encoded.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.Encode.sourceDone'>sourceDone</oberon-param> &gt; <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>-<oberon-const href='#maxUCS2EncodingLength'>maxUCS2EncodingLength</oberon-const> <emph>or</emph> <oberon-param href='#CodecDesc.Encode.destDone'>destDone</oberon-param> &gt; <oberon-param href='#CodecDesc.Encode.destEnd'>destEnd</oberon-param>-<oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>.  This implies, that the encoding algorithm continues until it gets near the end of the source or destination buffer.  But the implementation of the encoding algorithm can be set up in such a way, that it stops when the input or output sequence of the next character <emph>may</emph> not fit into the buffers.  It must not decode the maximum number of bytes that fit into the buffers.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'>If the procedure was started with <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>-<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param> &lt; <oberon-const href='#maxUCS2EncodingLength'>maxUCS2EncodingLength</oberon-const>, and if there is enough room in the destination buffer to store the whole result, then all remaining bytes in the source sequence have been encoded and <oberon-param href='#CodecDesc.Encode.sourceDone'>sourceDone</oberon-param> equals <oberon-param href='#CodecDesc.Encode.sourceEnd'>sourceEnd</oberon-param>.</p>
            </item>
            <item pad-after='yes'>
              <p pad-after='no' no-indent='yes'>Every malformed character, and every character code that can not be mapped onto a valid encoding, is replaced with <oberon-const href='#encodeError'>encodeError</oberon-const>, and the counter <oberon-field href='#CodecDesc.invalidChars'>codec.invalidChars</oberon-field> is incremented by one.  Out of range Unicode characters encoded as a (high, low) surrogate pair are recognized as a <emph>single</emph> invalid character.  The character codes U+FFFE and U+FFFF are also mapped to <oberon-const href='#encodeError'>encodeError</oberon-const>.</p>
            </item>
            <item pad-after='no'>
              <p pad-after='no' no-indent='yes'><samp><oberon-param href='#CodecDesc.Encode.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.Encode.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.destDone'>destDone</oberon-param>[</samp> holds the result of encoding <samp><oberon-param href='#CodecDesc.Encode.source'>source</oberon-param>[<oberon-param href='#CodecDesc.Encode.sourceStart'>sourceStart</oberon-param>, <oberon-param href='#CodecDesc.Encode.sourceDone'>sourceDone</oberon-param>[</samp>.</p>
            </item>
          </itemize>
        </post-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='codec' id='CodecDesc.Encode.codec' export='no' variable-parameter='no'>
          <type>
            <type-name name='Codec' href='#Codec'/>
          </type>
        </receiver-decl>
        <parameter-decl name='source' id='CodecDesc.Encode.source' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='LONGCHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceStart' id='CodecDesc.Encode.sourceStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceEnd' id='CodecDesc.Encode.sourceEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='dest' id='CodecDesc.Encode.dest' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='destStart' id='CodecDesc.Encode.destStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destEnd' id='CodecDesc.Encode.destEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='sourceDone' id='CodecDesc.Encode.sourceDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destDone' id='CodecDesc.Encode.destDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
    <procedure name='EncodeBOM' id='CodecDesc.EncodeBOM' export='yes'>
      <oberon-doc>
        <summary>Appends a byte order mark to <oberon-param href='#CodecDesc.EncodeBOM.dest'>dest</oberon-param>.</summary>
        <p pad-after='yes' no-indent='yes'>Appends a byte order mark to <oberon-param href='#CodecDesc.EncodeBOM.dest'>dest</oberon-param>.  If the field <oberon-field href='#CodecDesc.bom'>codec.bom</oberon-field> is <oberon-const href='#bomNotApplicable'>bomNotApplicable</oberon-const>, nothing is done and <oberon-param href='#CodecDesc.EncodeBOM.destDone'>destDone</oberon-param> is set to <oberon-param href='#CodecDesc.EncodeBOM.destStart'>destStart</oberon-param>.  Otherwise, the codec-specific encoding of the byte order mark is appended to <oberon-param href='#CodecDesc.EncodeBOM.dest'>dest</oberon-param>, and <oberon-param href='#CodecDesc.EncodeBOM.destDone'>destDone</oberon-param> is set to the position after the mark.</p>
        <pre-cond pad-after='yes'>
          <p pad-after='no' no-indent='yes'><oberon-param href='#CodecDesc.EncodeBOM.destEnd'>destEnd</oberon-param>-<oberon-param href='#CodecDesc.EncodeBOM.destStart'>destStart</oberon-param> &gt;= <oberon-const href='#maxUTF8EncodingLength'>maxUTF8EncodingLength</oberon-const>.  In other words, there must be enough room in the destination sequence <samp><oberon-param href='#CodecDesc.EncodeBOM.dest'>dest</oberon-param>[<oberon-param href='#CodecDesc.EncodeBOM.destStart'>destStart</oberon-param>, <oberon-param href='#CodecDesc.EncodeBOM.destEnd'>destEnd</oberon-param>[</samp> to hold at least one UCS-4 character, possibly encoded as a sequence of 6 bytes.</p>
        </pre-cond>
      </oberon-doc>
      <formal-parameters>
        <receiver-decl name='codec' id='CodecDesc.EncodeBOM.codec' export='no' variable-parameter='no'>
          <type>
            <type-name name='Codec' href='#Codec'/>
          </type>
        </receiver-decl>
        <parameter-decl name='dest' id='CodecDesc.EncodeBOM.dest' export='no' variable-parameter='yes'>
          <type>
            <array>
              <element-type>
                <type-name module='#predef' name='CHAR'/>
              </element-type>
            </array>
          </type>
        </parameter-decl>
        <parameter-decl name='destStart' id='CodecDesc.EncodeBOM.destStart' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destEnd' id='CodecDesc.EncodeBOM.destEnd' export='no' variable-parameter='no'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
        <parameter-decl name='destDone' id='CodecDesc.EncodeBOM.destDone' export='no' variable-parameter='yes'>
          <type>
            <type-name module='#predef' name='LONGINT'/>
          </type>
        </parameter-decl>
      </formal-parameters>
    </procedure>
  </class>
</interface-description>
