[GH-ISSUE #453] Sieve filters export does not use unicode #437

Closed
opened 2026-02-27 11:11:46 +03:00 by kerem · 1 comment
Owner

Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/453

Originally assigned to: @tonioo on GitHub.

Originally created by Miroslav Abrahám on 2013-09-03T10:38:19Z

When exporting sieve filters with some unicode chars in those rules, the exported file is not properly encoded. This little patch should do it.

--- modoboa/extensions/sievefilters/views.py.old        2013-09-03 12:31:27.234897323 +0200
+++ modoboa/extensions/sievefilters/views.py    2013-09-03 12:30:29.142899832 +0200
@@ -261,7 +261,7 @@
         return ajax_response(request, "ko", respmsg=str(e))

     resp = HttpResponse(script)
-    resp["Content-Type"] = "text/plain"
+    resp["Content-Type"] = "text/plain; charset=utf-8"
     resp["Content-Length"] = len(script)
     resp["Content-Disposition"] = 'attachment; filename="%s.txt"' % name
     return resp
Originally created by @tonioo on GitHub (Dec 4, 2013). Original GitHub issue: https://github.com/modoboa/modoboa/issues/453 Originally assigned to: @tonioo on GitHub. **Originally created by Miroslav Abrahám on 2013-09-03T10:38:19Z** When exporting sieve filters with some unicode chars in those rules, the exported file is not properly encoded. This little patch should do it. <pre> --- modoboa/extensions/sievefilters/views.py.old 2013-09-03 12:31:27.234897323 +0200 +++ modoboa/extensions/sievefilters/views.py 2013-09-03 12:30:29.142899832 +0200 @@ -261,7 +261,7 @@ return ajax_response(request, "ko", respmsg=str(e)) resp = HttpResponse(script) - resp["Content-Type"] = "text/plain" + resp["Content-Type"] = "text/plain; charset=utf-8" resp["Content-Length"] = len(script) resp["Content-Disposition"] = 'attachment; filename="%s.txt"' % name return resp </pre>
kerem 2026-02-27 11:11:46 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2013-09-03T17:22:23Z

Applied in changeset commit:70dafb1f9827511f55e0b46ef1382999c40601dd.

<!-- gh-comment-id:29816700 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2013-09-03T17:22:23Z** Applied in changeset commit:70dafb1f9827511f55e0b46ef1382999c40601dd.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#437
No description provided.