# File lib/UniversalDetector.rb, line 97
        def feed(data)
            if @done || data.empty?
                return 
            end
            unless  @_mGotData
                # If the data starts with BOM, we know it is UTF
                if data[0,3] == "\xEF\xBB\xBF":
                    # EF BB BF  UTF-8 with BOM
                    @result = {"encoding"=> "UTF-8", "confidence"=> 1.0}
                elsif data[0,4] == "\xFF\xFE\x00\x00":
                    # FF FE 00 00  UTF-32, little-endian BOM
                    @result = {"encoding"=> "UTF-32LE", "confidence"=> 1.0}
                elsif data[0,4] == "\x00\x00\xFE\xFF": 
                    # 00 00 FE FF  UTF-32, big-endian BOM
                    @result = {"encoding"=> "UTF-32BE", "confidence"=> 1.0}
                elsif data[0,4] == "\xFE\xFF\x00\x00":
                    # FE FF 00 00  UCS-4, unusual octet order BOM (3412)
                    @result = {"encoding"=> "X-ISO-10646-UCS-4-3412", "confidence"=> 1.0}
                elsif data[0,4] == "\x00\x00\xFF\xFE":
                    # 00 00 FF FE  UCS-4, unusual octet order BOM (2143)
                    @result = {"encoding"=> "X-ISO-10646-UCS-4-2143", "confidence"=> 1.0}
                elsif data[0,4] == "\xFF\xFE":
                    # FF FE  UTF-16, little endian BOM
                    @result = {"encoding"=> "UTF-16LE", "confidence"=> 1.0}
                elsif data[0,2] == "\xFE\xFF":
                    # FE FF  UTF-16, big endian BOM
                    @result = {"encoding"=> "UTF-16BE", "confidence"=> 1.0}          
                end
            end
            @_mGotData = true
            if @result["encoding"] && @result["confidence"] > 0.0
                @done = true
                return
            end            
            
            if @_mInputState == :PureAscii
                if data =~ @_highBitDetector
                    @_mInputState = :Highbyte
                elsif (@_mLastChar + data) =~ @_escDetector
                    @_mInputState = :EscAscii
                end
            end                        
            
            @_mLastChar = data[-1]
            if @_mInputState == :EscAscii
                unless @_mEscCharSetProber
                    @_mEscCharSetProber = EscCharSetProber.new
                end
                if @_mEscCharSetProber.feed(data) == constants.eFoundIt
                    @result = {"encoding"=> @_mEscCharSetProber.get_charset_name() ,"confidence"=> @_mEscCharSetProber.get_confidence()}
                    @done = true          
                end  
            elsif @_mInputState == :Highbyte
                if @_mCharSetProbers.empty?
                    @_mCharSetProbers = MBCSGroupProber.new.mProbers + SBCSGroupProber.new.mProbers + [Latin1Prober.new]
                end                                
                @_mCharSetProbers.each do |prober|                    
                    if prober.feed(data) == :FoundIt
                        @result = {"encoding"=> prober.get_charset_name(), "confidence"=> prober.get_confidence()}
                        @done = true
                        break
                    end
                end #for
            end
        end