import six


def tonative(n, encoding='ISO-8859-1'):
    """Return the given string as a native string in the given encoding."""
    # In Python 2, the native string type is bytes.
    if isinstance(n, six.text_type):  # unicode for Python 2
        return n.encode(encoding)
    return n