MODULE EncStdMap_cp869;

	(* This file was generated automatically *)

	(* Source: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP869.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..7FH: y := 00H + x
			| 0386H: y := 86H
			| 255DH,2580H: y := -24A1H + x
			| 0ABH: y := 0AEH
			| 0388H: y := 8DH
			| 0389H,038AH,038CH: y := -02FAH + x
			| 038EH: y := 95H
			| 038FH: y := 98H
			| 2566H: y := 0CBH
			| 2514H: y := 0C0H
			| 2534H: y := 0C1H
			| 2524H: y := 0B4H
			| 0390H: y := 0A1H
			| 0391H..0397H: y := -02EDH + x
			| 0398H,0399H: y := -02ECH + x
			| 255AH: y := 0C8H
			| 252CH: y := 0C2H
			| 039AH..039DH: y := -02E5H + x
			| 0A8H: y := 0F9H
			| 03B1H..03B3H: y := -02DBH + x
			| 03A0H,03A1H: y := -02DAH + x
			| 2502H: y := 0B3H
			| 03B4H,03B5H,03C3H: y := -02D7H + x
			| 03B6H..03C1H,03C4H: y := -02D6H + x
			| 03C2H: y := 0EDH
			| 03A3H..03A9H: y := -02D4H + x
			| 03C5H..03C7H: y := -02D3H + x
			| 03C8H: y := 0F6H
			| 03CEH: y := 0FDH
			| 03CBH: y := 0FBH
			| 03C9H: y := 0FAH
			| 253CH: y := 0C5H
			| 2591H..2593H: y := -24E1H + x
			| 039EH,039FH: y := -02E1H + x
			| 2554H: y := 0C9H
			| 0B1H: y := 0F1H
			| 2518H: y := 0D9H
			| 0ADH: y := 0F0H
			| 2500H: y := 0C4H
			| 0B0H: y := 0F8H
			| 03B0H: y := 0FCH
			| 0A7H: y := 0F5H
			| 2563H: y := 0B9H
			| 0B7H: y := 88H
			| 2588H: y := 0DBH
			| 250CH: y := 0DAH
			| 03CAH,03CCH,03CDH: y := -032AH + x
			| 2015H: y := 8EH
			| 2584H: y := 0DCH
			| 2557H: y := 0BBH
			| 0ACH: y := 89H
			| 25A0H: y := 0FEH
			| 0A0H: y := 0FFH
			| 2569H: y := 0CAH
			| 256CH: y := 0CEH
			| 0A6H: y := 8AH
			| 2510H: y := 0BFH
			| 0B2H,0B3H: y := -19H + x
			| 2551H: y := 0BAH
			| 0384H: y := 0EFH
			| 2560H: y := 0CCH
			| 0A9H,0BDH: y := -12H + x
			| 03ACH: y := 9BH
			| 03ADH..03AFH: y := -0310H + x
			| 0385H: y := 0F7H
			| 2018H,2019H: y := -1F8DH + x
			| 0BBH: y := 0AFH
			| 251CH: y := 0C3H
			| 03ABH: y := 96H
			| 0A3H: y := 9CH
			| 2550H: y := 0CDH
			| 03AAH: y := 91H
			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..7FH: y := 00H + x
			| 86H: y := 0386H
			| 0CDH: y := 2550H
			| 0F9H: y := 0A8H
			| 8EH: y := 2015H
			| 0BAH: y := 2551H
			| 0AFH: y := 0BBH
			| 8BH,8CH: y := 1F8DH + x
			| 0F7H: y := 0385H
			| 9DH..9FH: y := 0310H + x
			| 9BH: y := 03ACH
			| 97H,0ABH: y := 12H + x
			| 0CCH: y := 2560H
			| 96H: y := 03ABH
			| 91H: y := 03AAH
			| 99H,9AH: y := 19H + x
			| 0CBH: y := 2566H
			| 8AH: y := 0A6H
			| 0CEH: y := 256CH
			| 0CAH: y := 2569H
			| 0BCH,0DFH: y := 24A1H + x
			| 0FEH: y := 25A0H
			| 89H: y := 0ACH
			| 0DCH: y := 2584H
			| 0BBH: y := 2557H
			| 0A0H,0A2H,0A3H: y := 032AH + x
			| 9CH: y := 0A3H
			| 0DBH: y := 2588H
			| 88H: y := 0B7H
			| 0DAH: y := 250CH
			| 0FCH: y := 03B0H
			| 0F8H: y := 0B0H
			| 0C4H: y := 2500H
			| 0F0H: y := 0ADH
			| 0D9H: y := 2518H
			| 0F1H: y := 0B1H
			| 0C9H: y := 2554H
			| 0C8H: y := 255AH
			| 0BDH,0BEH: y := 02E1H + x
			| 0C5H: y := 253CH
			| 0B3H: y := 2502H
			| 0FBH: y := 03CBH
			| 0BFH: y := 2510H
			| 0F6H: y := 03C8H
			| 0F2H..0F4H: y := 02D3H + x
			| 0C0H: y := 2514H
			| 0EDH: y := 03C2H
			| 0E0H..0EBH,0EEH: y := 02D6H + x
			| 0DDH,0DEH,0ECH: y := 02D7H + x
			| 0C3H: y := 251CH
			| 0C6H,0C7H: y := 02DAH + x
			| 0D6H..0D8H: y := 02DBH + x
			| 0FFH: y := 0A0H
			| 0FAH: y := 03C9H
			| 0F5H: y := 0A7H
			| 0B0H..0B2H: y := 24E1H + x
			| 0B5H..0B8H: y := 02E5H + x
			| 0FDH: y := 03CEH
			| 0C2H: y := 252CH
			| 0ACH,0ADH: y := 02ECH + x
			| 0A4H..0AAH: y := 02EDH + x
			| 0A1H: y := 0390H
			| 0B4H: y := 2524H
			| 0B9H: y := 2563H
			| 0C1H: y := 2534H
			| 0CFH..0D5H: y := 02D4H + x
			| 98H: y := 038FH
			| 95H: y := 038EH
			| 8FH,90H,92H: y := 02FAH + x
			| 8DH: y := 0388H
			| 0AEH: y := 0ABH
			| 0EFH: y := 0384H
			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_cp869.