diff --git a/ietf/secr/proceedings/utils.py b/ietf/secr/proceedings/utils.py index 8e9dc6ef4..39d9a6a05 100644 --- a/ietf/secr/proceedings/utils.py +++ b/ietf/secr/proceedings/utils.py @@ -4,6 +4,7 @@ import os from django.conf import settings from django.contrib import messages +from django.utils.encoding import smart_text import debug # pyflakes:ignore @@ -36,8 +37,9 @@ def handle_upload_file(file,filename,meeting,subdir, request=None): destination = open(os.path.join(path,filename), 'wb+') if extension in settings.MEETING_VALID_MIME_TYPE_EXTENSIONS['text/html']: file.open() - text = file.read().decode('utf-8') - # Whole file sanitization; add back '' (sanitize will remove it) + text = smart_text(file.read()) + # Whole file sanitization; add back what's missing from a complete + # document (sanitize will remove these). clean = u"""