MODULE EncStdMap_georgian_ps;

	(* This file was generated automatically *)

	(* Source: http://www.math.nmsu.edu/~mleisher/Software/csets/GEO-PS.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..81H: y := x
			| 8DH..90H: y := x
			| 9DH..9EH: y := x
			| 0A0H..0BFH: y := x
			| 0E6H..0FFH: y := x
			| 0152H: y := 8CH
			| 0153H: y := 9CH
			| 0160H: y := 8AH
			| 0161H: y := 9AH
			| 0178H: y := 9FH
			| 0192H: y := 83H
			| 02C6H: y := 88H
			| 02DCH: y := 98H
			| 10D0H..10D6H: y := x - 1010H
			| 10D7H..10DCH: y := x - 100FH
			| 10DDH..10E2H: y := x - 100EH
			| 10E3H..10EEH: y := x - 100DH
			| 10EFH..10F0H: y := x - 100CH
			| 10F1H: y := 0C7H
			| 10F2H: y := 0CEH
			| 10F3H: y := 0D5H
			| 10F4H: y := 0E2H
			| 10F5H: y := 0E5H
			| 2013H..2014H: y := x - 1F7DH
			| 2018H..2019H: y := x - 1F87H
			| 201AH: y := 82H
			| 201CH..201DH: y := x - 1F89H
			| 201EH: y := 84H
			| 2020H..2021H: y := x - 1F9AH
			| 2022H: y := 95H
			| 2026H: y := 85H
			| 2030H: y := 89H
			| 2039H: y := 8BH
			| 203AH: y := 9BH
			| 2122H: y := 99H
			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..81H: y := x
			| 82H: y := 201AH
			| 83H: y := 0192H
			| 84H: y := 201EH
			| 85H: y := 2026H
			| 86H..87H: y := x + 1F9AH
			| 88H: y := 02C6H
			| 89H: y := 2030H
			| 8AH: y := 0160H
			| 8BH: y := 2039H
			| 8CH: y := 0152H
			| 8DH..90H: y := x
			| 91H..92H: y := x + 1F87H
			| 93H..94H: y := x + 1F89H
			| 95H: y := 2022H
			| 96H..97H: y := x + 1F7DH
			| 98H: y := 02DCH
			| 99H: y := 2122H
			| 9AH: y := 0161H
			| 9BH: y := 203AH
			| 9CH: y := 0153H
			| 9DH..9EH: y := x
			| 9FH: y := 0178H
			| 0A0H..0BFH: y := x
			| 0C0H..0C6H: y := x + 1010H
			| 0C7H: y := 10F1H
			| 0C8H..0CDH: y := x + 100FH
			| 0CEH: y := 10F2H
			| 0CFH..0D4H: y := x + 100EH
			| 0D5H: y := 10F3H
			| 0D6H..0E1H: y := x + 100DH
			| 0E2H: y := 10F4H
			| 0E3H..0E4H: y := x + 100CH
			| 0E5H: y := 10F5H
			| 0E6H..0FFH: y := x
			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_georgian_ps.