<commit_before>"""Views for the resource application."""

from urllib.parse import quote
from django.conf import settings
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, render
from django.views import generic
from resources.models import Resource
from resources.utils.resource_pdf_cache import resource_pdf_cache
from resources.utils.get_options_html import get_options_html
from utils.group_lessons_by_age import group_lessons_by_age
from resources.utils.get_resource_generator import get_resource_generator
from utils.errors.QueryParameterMissingError import QueryParameterMissingError
from utils.errors.QueryParameterInvalidError import QueryParameterInvalidError
from utils.errors.QueryParameterMultipleValuesError import QueryParameterMultipleValuesError

RESPONSE_CONTENT_DISPOSITION = 'attachment; filename="{filename}.pdf"'

<commit_msg>Fix RESPONSE_CONTENT_DISPOSITION to allow UTF-8 filenames<commit_after>"""Views for the resource application."""

from urllib.parse import quote
from django.conf import settings
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404, render
from django.views import generic
from resources.models import Resource
from resources.utils.resource_pdf_cache import resource_pdf_cache
from resources.utils.get_options_html import get_options_html
from utils.group_lessons_by_age import group_lessons_by_age
from resources.utils.get_resource_generator import get_resource_generator
from utils.errors.QueryParameterMissingError import QueryParameterMissingError
from utils.errors.QueryParameterInvalidError import QueryParameterInvalidError
from utils.errors.QueryParameterMultipleValuesError import QueryParameterMultipleValuesError

RESPONSE_CONTENT_DISPOSITION = "attachment; filename*=UTF-8''{filename}.pdf; filename=\"{filename}.pdf\""


{'fraction_non_alphanumeric': 0.05045625335480408, 'fraction_numerical': 0.007514761137949544, 'mean_word_length': 9.021505376344086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4601028', 'n_tokens_mistral': 481, 'n_tokens_neox': 473, 'n_words': 130}