'Decode infile to unicode. Using the specified encoding.
if is a string, it also needs converting to a list.'

def _decode(self, infile, encoding):

    if isinstance(infile, basestring):
        return infile.decode(encoding).splitlines(True)
    for (i, line) in enumerate(infile):
        if (not isinstance(line, unicode)):
            infile[i] = line.decode(encoding)
    return infile
