def build_content_type(format, encoding='utf-8'):
    """
    Appends character encoding to the provided format if not already present.
    """
    if 'charset' in format:
        return format

    if format in ('application/json', 'text/javascript'):
        return format

    return "%s; charset=%s" % (format, encoding)
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/utils/mime.py/build_content_type/original