Skip to content

Commit

Permalink
fix: use encoded filename for arabic (latin) language while exporting
Browse files Browse the repository at this point in the history
(cherry picked from commit 4c9dea8)
  • Loading branch information
shariquerik authored and mergify[bot] committed Dec 7, 2023
1 parent d1b86e1 commit df165dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frappe/utils/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def as_pdf():
def as_binary():
response = Response()
response.mimetype = "application/octet-stream"
response.headers.add("Content-Disposition", None, filename=frappe.response["filename"])
filename = frappe.response["filename"]
filename = filename.encode("utf-8").decode("unicode-escape", "ignore")
response.headers.add("Content-Disposition", None, filename=filename)
response.data = frappe.response["filecontent"]
return response

Expand Down

0 comments on commit df165dd

Please sign in to comment.