summary refs log tree commit diff
path: root/synapse/util/stringutils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-27 10:03:58 +0100
committerErik Johnston <erik@matrix.org>2015-08-27 10:03:58 +0100
commite330c802e4d653e2ccae83fbcd4c2feaaeffdfe1 (patch)
tree96518f02f3b845794c270da3c026d0d157dd52e2 /synapse/util/stringutils.py
parentMerge pull request #252 from matrix-org/erikj/typing_loop (diff)
parentGive a sensible error message if the filename is invalid UTF-8 (diff)
downloadsynapse-e330c802e4d653e2ccae83fbcd4c2feaaeffdfe1.tar.xz
Merge pull request #259 from matrix-org/markjh/unicode_content_disposition
Support unicode attachment filenames
Diffstat (limited to 'synapse/util/stringutils.py')
-rw-r--r--synapse/util/stringutils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/util/stringutils.py b/synapse/util/stringutils.py
index 7a1e96af37..f3a36340e4 100644
--- a/synapse/util/stringutils.py
+++ b/synapse/util/stringutils.py
@@ -38,6 +38,8 @@ def random_string_with_symbols(length):
 def is_ascii(s):
     try:
         s.encode("ascii")
+    except UnicodeEncodeError:
+        return False
     except UnicodeDecodeError:
         return False
     else: