MODULE EncStdMap_iso8859_14;

	(* This file was generated automatically *)

	(* Source: http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-14.TXT *)

	IMPORT Codecs := EncCodecs;

	TYPE
		Encoder = POINTER TO RECORD (Codecs.Encoder) END;
		Decoder = POINTER TO RECORD (Codecs.Decoder) END;

	(* Encoder *)

	PROCEDURE (e: Encoder) Encode (IN f: ARRAY OF CHAR; VAR fR, fLen: INTEGER; VAR t: ARRAY OF SHORTCHAR; VAR tW: INTEGER);
		VAR x, y: INTEGER;
	BEGIN
		WHILE fLen > 0 DO
			x := ORD(f[fR]);
			CASE x OF
			| 00H..0A0H,0A3H,0A7H,0A9H,0ADH,0AEH,0B6H,0C0H..0CFH,0D1H..0D6H,0D8H..0DDH,0DFH..0EFH,0F1H..0F6H,0F8H..0FDH,0FFH: y := 00H + x
			| 0177H: y := 0FEH
			| 1E6BH: y := 0F7H
			| 1E1EH,1E1FH: y := -1D6EH + x
			| 010AH,010BH: y := -66H + x
			| 1E0AH: y := 0A6H
			| 0120H,0121H: y := -6EH + x
			| 1E02H,1E03H: y := -1D61H + x
			| 1E0BH: y := 0ABH
			| 1E80H,1E82H: y := -1DD8H + x
			| 1E81H,1E83H: y := -1DC9H + x
			| 1E84H,1E85H: y := -1DC7H + x
			| 1EF2H: y := 0ACH
			| 1EF3H: y := 0BCH
			| 0178H: y := 0AFH
			| 1E60H: y := 0BBH
			| 0174H: y := 0D0H
			| 1E61H: y := 0BFH
			| 1E56H: y := 0B7H
			| 1E57H: y := 0B9H
			| 0176H: y := 0DEH
			| 1E6AH: y := 0D7H
			| 1E40H,1E41H: y := -1D8CH + x
			| 0175H: y := 0F0H
			ELSE
				RETURN
			END;
			t[tW] := SHORT(CHR(y)); INC(tW);
			INC(fR); DEC(fLen)
		END
	END Encode;

	PROCEDURE NewEncoder* (): Codecs.Encoder;
		VAR e: Encoder;
	BEGIN
		NEW(e); RETURN e
	END NewEncoder;

	(* Decoder *)

	PROCEDURE (d: Decoder) Decode (IN f: ARRAY OF SHORTCHAR; VAR fR, fLen: INTEGER; VAR t: ARRAY OF CHAR; VAR tW: INTEGER; OUT state: BOOLEAN);
		VAR x, y: INTEGER;
	BEGIN
		WHILE fLen > 0 DO
			x := ORD(f[fR]);
			CASE x OF
			| 00H..0A0H,0A3H,0A7H,0A9H,0ADH,0AEH,0B6H,0C0H..0CFH,0D1H..0D6H,0D8H..0DDH,0DFH..0EFH,0F1H..0F6H,0F8H..0FDH,0FFH: y := 00H + x
			| 0B8H,0BAH: y := 1DC9H + x
			| 0F0H: y := 0175H
			| 0B4H,0B5H: y := 1D8CH + x
			| 0D7H: y := 1E6AH
			| 0B2H,0B3H: y := 6EH + x
			| 0DEH: y := 0176H
			| 0B9H: y := 1E57H
			| 0B7H: y := 1E56H
			| 0BFH: y := 1E61H
			| 0D0H: y := 0174H
			| 0BBH: y := 1E60H
			| 0BCH: y := 1EF3H
			| 0ACH: y := 1EF2H
			| 0BDH,0BEH: y := 1DC7H + x
			| 0AFH: y := 0178H
			| 0A8H,0AAH: y := 1DD8H + x
			| 0ABH: y := 1E0BH
			| 0A1H,0A2H: y := 1D61H + x
			| 0A6H: y := 1E0AH
			| 0A4H,0A5H: y := 66H + x
			| 0B0H,0B1H: y := 1D6EH + x
			| 0F7H: y := 1E6BH
			| 0FEH: y := 0177H
			ELSE
				RETURN
			END;
			t[tW] := CHR(y); INC(tW);
			INC(fR); DEC(fLen)
		END;
		state := FALSE
	END Decode;

	PROCEDURE (d: Decoder) Reset, EMPTY;

	PROCEDURE NewDecoder* (): Codecs.Decoder;
		VAR d: Decoder;
	BEGIN
		NEW(d); RETURN d
	END NewDecoder;

END EncStdMap_iso8859_14.