diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-27 10:03:58 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-27 10:03:58 +0100 |
commit | e330c802e4d653e2ccae83fbcd4c2feaaeffdfe1 (patch) | |
tree | 96518f02f3b845794c270da3c026d0d157dd52e2 /synapse/util | |
parent | Merge pull request #252 from matrix-org/erikj/typing_loop (diff) | |
parent | Give a sensible error message if the filename is invalid UTF-8 (diff) | |
download | synapse-e330c802e4d653e2ccae83fbcd4c2feaaeffdfe1.tar.xz |
Merge pull request #259 from matrix-org/markjh/unicode_content_disposition
Support unicode attachment filenames
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/stringutils.py | 2 |
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: |