SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST

# Codec:Latin1

### Import List

        ADT:StringBuffer
        Codec
        Object
        Object
        RT0

Class List
Decoder |
Encoder |
Latin1 |

Class Summary: Decoder [Detail]
      +---Codec.Decoder
           |
           +--Codec:Latin1.Decoder
Method Summary
Decode(ARRAY OF CHAR, LONGINT, LONGINT, StringBuffer) Decode the 8-bit character sequence in ``data[start, end-1]`' starting with the decoder state dec.
Inherited Methods
From Codec.Decoder: Decode, End, INIT, Reset, Start

Class Summary: Encoder [Detail]
      +---Codec.Encoder
           |
           +--Codec:Latin1.Encoder
Method Summary
EncodeLatin1(ARRAY OF CHAR, LONGINT, LONGINT, StringBuffer) Encode the Latin1 character sequence in ``s[start, end-1]`' starting with the encoder state enc.
EncodeUTF16(ARRAY OF LONGCHAR, LONGINT, LONGINT, StringBuffer) Encode the UTF-16 character sequence in ``s[start, end-1]`' starting with the encoder state enc.
Inherited Methods
From Codec.Encoder: Closure, Encode, EncodeLatin1, EncodeUTF16, End, INIT, Reset, SetEscapeEncoder, Start

Class Summary: Latin1 [Detail]
      +---RT0.Object
           |
           +---Object.Object
                |
                +---Codec.Codec
                     |
                     +--Codec:Latin1.Latin1
Inherited Fields
From Codec.Codec: class, preferredName
Method Summary
DecodeRegion(ARRAY OF CHAR, LONGINT, LONGINT): STRING Decode the 8-bit character sequence in ``data[start, end-1]`'.
EncodeRegion(STRING, LONGINT, LONGINT): String8 Encode Unicode sequence in ``s[start, end-1]`' into the 8-bit character sequence.
INIT(ARRAY OF CHAR)
NewDecoder(): Decoder Creates a decoder object for the codec c.
NewEncoder(): Encoder Creates an encoder object for the codec c.
Inherited Methods
From RT0.Object: Finalize From Object.Object: Equals, HashCode, ToString From Codec.Codec: Decode, DecodeRegion, Encode, EncodeRegion, INIT, NewDecoder, NewEncoder

Procedure Summary
Register()

Variable Summary
codec-: Latin1

Class Detail: Decoder

Method Detail

### Decode

    PROCEDURE (dec: Decoder) Decode(data: ARRAY OF CHAR;
                     start: LONGINT;
                     end: LONGINT;
                     b: StringBuffer)

> Decode the 8-bit character sequence in ``data[start, end-1]`' starting with the decoder state dec. The result is appended to the string buffer b. On completion, dec is updated to reflect the decoder's state after the last byte of the sequence has been processed.

> Pre-condition: ``0 <= start <= end <= LEN(data)`'. dec.Start has been called.

> [Description inherited from Decode]

> Redefines: Decode

Class Detail: Encoder

Method Detail

### EncodeLatin1

    PROCEDURE (enc: Encoder) EncodeLatin1(s: ARRAY OF CHAR;
                           start: LONGINT;
                           end: LONGINT;
                           b: StringBuffer)

> Encode the Latin1 character sequence in ``s[start, end-1]`' starting with the encoder state enc. The result is a string holding only code points in the range ``[U+0000, U+00FF]`', which is appended to the string buffer b. On completion, enc is updated to reflect the encoder's state after the last byte of the sequence has been processed.

> Pre-condition: ``0 <= start <= end <= s.length`'. enc.Start has been called. All code points in ``data[start, end-1]`' are valid. That is, neither is out of range nor from the surrogate areas.

> [Description inherited from EncodeLatin1]

> Redefines: EncodeLatin1

### EncodeUTF16

    PROCEDURE (enc: Encoder) EncodeUTF16(s: ARRAY OF LONGCHAR;
                          start: LONGINT;
                          end: LONGINT;
                          b: StringBuffer)
      RAISES EncodingError;

> Encode the UTF-16 character sequence in ``s[start, end-1]`' starting with the encoder state enc. The result is a string holding only code points in the range ``[U+0000, U+00FF]`', which is appended to the string buffer b. On completion, enc is updated to reflect the encoder's state after the last byte of the sequence has been processed.

> Pre-condition: ``0 <= start <= end <= s.length`'. enc.Start has been called. All code points in ``data[start, end-1]`' are valid. That is, neither is out of range nor from the surrogate areas.

> [Description inherited from EncodeUTF16]

> Redefines: EncodeUTF16

Class Detail: Latin1

Method Detail

### DecodeRegion

    PROCEDURE (c: Latin1) DecodeRegion(data: ARRAY OF CHAR;
                           start: LONGINT;
                           end: LONGINT): STRING

> Decode the 8-bit character sequence in ``data[start, end-1]`'. For succesful completion, the byte sequence ``data[start, end-1]`' must be well formed with respect to the decoder, and the resulting Unicode code points must all be valid.

> Pre-condition: ``0 <= start <= end <= LEN(data)`'.

> [Description inherited from DecodeRegion]

> Redefines: DecodeRegion

### EncodeRegion

    PROCEDURE (c: Latin1) EncodeRegion(s: STRING;
                           start: LONGINT;
                           end: LONGINT): String8

> Encode Unicode sequence in ``s[start, end-1]`' into the 8-bit character sequence. The result is stored in a string holding only code points in the range ``[U+0000, U+00FF]`'.

> Pre-condition: ``0 <= start <= end <= s.length`'. All code points in ``data[start, end-1]`' are valid. That is, neither is out of range nor from the surrogate areas.

> [Description inherited from EncodeRegion]

> Redefines: EncodeRegion

### INIT

    PROCEDURE (c: Latin1) INIT(preferredName: ARRAY OF CHAR)

> Redefines: INIT

### NewDecoder

    PROCEDURE (c: Latin1) NewDecoder(): Decoder

> Creates a decoder object for the codec c. Note: Some decoders, like those implementing an decryption algorithm, require additional settings before they can be used.

> [Description inherited from NewDecoder]

> Redefines: NewDecoder

### NewEncoder

    PROCEDURE (c: Latin1) NewEncoder(): Encoder

> Creates an encoder object for the codec c. By default, any character sequences the encoder cannot handle cause it to raise an exception EncodingError.

> Note: Some encoders, like those implementing encryption algorithm, require additional settings before they can be used.

> [Description inherited from NewEncoder]

> Redefines: NewEncoder

Procedure Detail

### Register

    PROCEDURE Register()

Variable Detail

### codec

    VAR codec-: Latin1