import six


def native_str(val, encoding='UTF-8'):
    """ format to native string (support int type) """
    if val is None:
        return val
    if isinstance(val, int):
        return str(val)
    try:
        return six.ensure_str(val, encoding=encoding)
    except TypeError:
        return str(val)