Just a simple function to return the system encoding (defaults to utf-8)

def _get_encodings():
    """
    Just a simple function to return the system encoding (defaults to utf-8)
    """
    stdout_encoding = sys.stdout.encoding if sys.stdout.encoding else 'utf-8'
    stderr_encoding = sys.stderr.encoding if sys.stderr.encoding else 'utf-8'
    return stdout_encoding, stderr_encoding