anchor.diff:      function NextChar: TBuffChar; override;
     end;
   
  -  // BG, 02.10.2012: converts code page 858 using an AnsiCharHighMap to unicode.
  -  TBuffConvLatin1Euro = class(TBuffConverter)
  +  TBuffBaseConverter = class(TBuffConverter)
  +  protected
  +    function ASCIIDecodeChar(c1: Byte): TBuffChar;
  +    function CP922EstonianDecodeChar(c1: Byte): TBuffChar;
  +    function GB2312DecodeChar(c1, c2: Byte): TBuffChar;
  +    function ISO8859_11DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_15DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_5DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_6DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_7DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_8DecodeChar(c1: Byte): TBuffChar;
  +    function ISO8859_9DecodeChar(c1: Byte): TBuffChar;
  +    function JIS_X0201DecodeChar(c1: Byte): TBuffChar;
  +    function JIS_X0208DecodeChar(c1, c2: Byte): TBuffChar;
  +    function JIS_X0212DecodeChar(c1, c2: Byte): TBuffChar;
  +    function KSC5601DecodeChar(c1, c2: Byte): TBuffChar;
  +    function Latin1EuroDecodeChar(c1: Byte): TBuffChar;
  +    function MultiByteToWideCharDecodeChar(c1: Byte): TBuffChar;
  +  end;
  +
  +  // BG, 02.10.2012: converts several single byte code pages using one of the *DecoderChar functions to unicode.
  +  TBuffSingleByteDecoder = function(c1: Byte): TBuffChar of object;
  +  TBuffConvSingleByte = class(TBuffBaseConverter)
  +  private
  +    FDecoder: TBuffSingleByteDecoder;
  +    procedure UpdateDecoder;
  +  protected
  +    procedure Assign(Source: TBuffConverter); override;
     public
  +    procedure AfterConstruction; override;
       function NextChar: TBuffChar; override;
     end;
   
  -  TBuffConvEstonian922 = class(TBuffConverter)
  +  // BG, 02.10.2012: converts several single byte code pages using one of the *DecoderChar functions to unicode.
  +  TBuffDoubleByteDecoder = function(c1, c2: Byte): TBuffChar of object;
  +  TBuffConvDoubleByte = class(TBuffBaseConverter)
  +  private
  +    FDecoder: TBuffDoubleByteDecoder;
  +    procedure UpdateDecoder;
  +  protected
  +    procedure Assign(Source: TBuffConverter); override;
     public
  +    procedure AfterConstruction; override;
       function NextChar: TBuffChar; override;
     end;
   
  
positive.code: 
                  STATE3_DESIGNATED_CNS11643_2:
                  begin
                    c2 := GetNext;
                    c3 := GetNext;
                    case c2 of
                      $21..$72:
                        case c3 of
                          $21..$7E:
                          begin
                            i := 94 * (c2 - $21) + (c3 - $21);
                            if i < 7650 then
                              Result := CNS11643_2Map[i]
                            else
                              Result := TBuffChar(#$FFFD);
                          end;
                        else
                          Result := TBuffChar(#$FFFD);
                        end;
                    else
                      Result := TBuffChar(#$FFFD);
                    end;
                    Exit;
                  end;
  
  
negative.code:   end;
  
  var
    c1, c2: Word;
    i: Integer;
  begin
    c1 := GetNext;
  