(self, output, index=None, as_unicode=True)
return str(output)
Handle different encodings to safely read the data.
        Currently UTF-8, UTF-16 and ANSI are supported.

        Setting as_unicode to False will force encode any unicode characters into 8 bytes.
        Seems important for Python 2, but not so much for Python 3.
Handle different encodings to safely read the data.
        Currently UTF-8, UTF-16 and ANSI are supported.
Handle different encodings to safely read the data . Currently UTF - 8 UTF - 16 and ANSI are supported .
def _process_output(self, output, index=None, as_unicode=True):
        """Handle different encodings to safely read the data.
        Currently UTF-8, UTF-16 and ANSI are supported.

        Setting as_unicode to False will force encode any unicode characters into 8 bytes.
        Seems important for Python 2, but not so much for Python 3.
        """
        output = output.strip()
        
        #Remove any known markers from the start of file
        if index is not None and not index:
            if self.encoding == 'utf8' and ord(output[0]) == 65279:
                output = output[1:]
        
        if self.encoding is not None and not as_unicode:
            output = output.encode('utf8')
        
        output = output.strip()

        #Convert bytes to string if Python 3 (causes crash on Python 2)
        if PYTHON_VERSION == 2:
            return output
        return str(output)
def _process_output ( self , output , index = None , as_unicode = True ) : output = output . strip ( ) #Remove any known markers from the start of file if index is not None and not index : if self . encoding == 'utf8' and ord ( output [ 0 ] ) == 65279 : output = output [ 1 : ] if self . encoding is not None and not as_unicode : output = output . encode ( 'utf8' ) output = output . strip ( ) #Convert bytes to string if Python 3 (causes crash on Python 2) if PYTHON_VERSION == 2 : return output return str ( output )