Skip to content

Commit

Permalink
Preserve non-ASCII characters when downloading a zip
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Jan 10, 2024
1 parent a9dabb5 commit 5420566
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions qgis-app/base/views/processing_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
View,
)
from django.views.generic.base import ContextMixin
from django.utils.encoding import escape_uri_path

GROUP_NAME = "Style Managers"

Expand Down Expand Up @@ -484,9 +485,8 @@ def get(self, request, *args, **kwargs):
response = HttpResponse(
zipfile.getvalue(), content_type="application/x-zip-compressed"
)
response["Content-Disposition"] = "attachment; filename=%s.zip" % (
slugify(object.name, allow_unicode=True)
)
zip_name = slugify(object.name, allow_unicode=True)
response["Content-Disposition"] = f"attachment; filename*=utf-8''{escape_uri_path(zip_name)}.zip"
return response


Expand Down
2 changes: 1 addition & 1 deletion qgis-app/styles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class StyleReviewView(ResourceMixin, ResourceBaseReviewView):


class StyleDownloadView(ResourceMixin, ResourceBaseDownload):
"""Download a GeoPackage"""
"""Download a style"""


def style_nav_content(request):
Expand Down

0 comments on commit 5420566

Please sign in to comment.