MODULE EncStdMap_iso8859_2;

	(* This file was generated automatically *)

	(* Source: http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-2.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,0A4H,0A7H,0A8H,0ADH,0B0H,0B4H,0B8H,0C1H,0C2H,0C4H,0C7H,0C9H,0CBH,0CDH,0CEH,0D3H,0D4H,0D6H,0D7H,0DAH,0DCH,0DDH,0DFH,0E1H,0E2H,0E4H,0E7H,0E9H,0EBH,0EDH,0EEH,0F3H,0F4H,0F6H,0F7H,0FAH,0FCH,0FDH: y := 00H + x
			| 0158H: y := 0D8H
			| 017EH: y := 0BEH
			| 0150H: y := 0D5H
			| 016FH,0171H: y := -76H + x
			| 0147H,0155H: y := -75H + x
			| 0139H: y := 0C5H
			| 0143H: y := 0D1H
			| 0163H: y := 0FEH
			| 0104H: y := 0A1H
			| 0159H: y := 0F8H
			| 015BH,015FH: y := -0A5H + x
			| 0151H: y := 0F5H
			| 02D9H: y := 0FFH
			| 0148H: y := 0F2H
			| 013AH: y := 0E5H
			| 0105H: y := 0B1H
			| 0144H: y := 0F1H
			| 017DH: y := 0AEH
			| 0118H,011AH: y := -4EH + x
			| 0179H: y := 0ACH
			| 017BH: y := 0AFH
			| 02DDH: y := 0BDH
			| 010CH: y := 0C8H
			| 0106H,0110H: y := -40H + x
			| 0102H,010EH: y := -3FH + x
			| 017AH: y := 0BCH
			| 017CH: y := 0BFH
			| 0164H: y := 0ABH
			| 0160H: y := 0A9H
			| 02D8H: y := 0A2H
			| 015AH,015EH: y := -0B4H + x
			| 0119H,011BH: y := -2FH + x
			| 0165H: y := 0BBH
			| 02DBH: y := 0B2H
			| 0161H: y := 0B9H
			| 010DH: y := 0E8H
			| 0107H,0111H: y := -21H + x
			| 0103H,010FH: y := -20H + x
			| 0141H: y := 0A3H
			| 013DH: y := 0A5H
			| 016EH,0170H: y := -95H + x
			| 0154H: y := 0C0H
			| 02C7H: y := 0B7H
			| 0142H: y := 0B3H
			| 013EH: y := 0B5H
			| 0162H: y := 0DEH
			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,0A4H,0A7H,0A8H,0ADH,0B0H,0B4H,0B8H,0C1H,0C2H,0C4H,0C7H,0C9H,0CBH,0CDH,0CEH,0D3H,0D4H,0D6H,0D7H,0DAH,0DCH,0DDH,0DFH,0E1H,0E2H,0E4H,0E7H,0E9H,0EBH,0EDH,0EEH,0F3H,0F4H,0F6H,0F7H,0FAH,0FCH,0FDH: y := 00H + x
			| 0C6H,0D0H: y := 40H + x
			| 0DEH: y := 0162H
			| 0B5H: y := 013EH
			| 0D8H: y := 0158H
			| 0B3H: y := 0142H
			| 0B7H: y := 02C7H
			| 0C0H: y := 0154H
			| 0D9H,0DBH: y := 95H + x
			| 0A5H: y := 013DH
			| 0A3H: y := 0141H
			| 0BDH: y := 02DDH
			| 0E6H,0F0H: y := 21H + x
			| 0B6H,0BAH: y := 0A5H + x
			| 0B9H: y := 0161H
			| 0B2H: y := 02DBH
			| 0BBH: y := 0165H
			| 0EAH,0ECH: y := 2FH + x
			| 0A6H,0AAH: y := 0B4H + x
			| 0A2H: y := 02D8H
			| 0A9H: y := 0160H
			| 0ABH: y := 0164H
			| 0BFH: y := 017CH
			| 0BCH: y := 017AH
			| 0C3H,0CFH: y := 3FH + x
			| 0BEH: y := 017EH
			| 0E3H,0EFH: y := 20H + x
			| 0C8H: y := 010CH
			| 0AFH: y := 017BH
			| 0ACH: y := 0179H
			| 0CAH,0CCH: y := 4EH + x
			| 0AEH: y := 017DH
			| 0F1H: y := 0144H
			| 0B1H: y := 0105H
			| 0E5H: y := 013AH
			| 0F2H: y := 0148H
			| 0FFH: y := 02D9H
			| 0F5H: y := 0151H
			| 0E8H: y := 010DH
			| 0F8H: y := 0159H
			| 0A1H: y := 0104H
			| 0FEH: y := 0163H
			| 0D1H: y := 0143H
			| 0C5H: y := 0139H
			| 0D2H,0E0H: y := 75H + x
			| 0F9H,0FBH: y := 76H + x
			| 0D5H: y := 0150H
			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_2.