|
45 | 45 | from plone.registry.interfaces import IRegistry |
46 | 46 | from plone.supermodel.exportimport import BaseHandler |
47 | 47 | from Products.CMFCore.utils import getToolByName |
48 | | -from Products.CMFPlone.utils import safe_unicode |
| 48 | +from plone.base.utils import safe_text |
49 | 49 | from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
50 | 50 | from Products.PythonScripts.PythonScript import PythonScript |
51 | 51 | from six import BytesIO |
@@ -122,8 +122,8 @@ def serialize(self, field): |
122 | 122 | if isinstance(field, (int, float, Decimal, bool)): |
123 | 123 | return str(field) |
124 | 124 | if isinstance(field, six.string_types): |
125 | | - return safe_unicode(field) |
126 | | - return safe_unicode(repr(field)) |
| 125 | + return safe_text(field) |
| 126 | + return safe_text(repr(field)) |
127 | 127 |
|
128 | 128 | def onSuccess(self, fields, request): |
129 | 129 | raise NotImplementedError( |
@@ -291,9 +291,9 @@ def get_subject(self, fields, request, context): |
291 | 291 | subject = dollar_replacer(subject, fields) |
292 | 292 |
|
293 | 293 | if isinstance(subject, six.string_types): |
294 | | - subject = safe_unicode(subject) |
| 294 | + subject = safe_text(subject) |
295 | 295 | elif subject and isinstance(subject, (set, tuple, list)): |
296 | | - subject = ", ".join([safe_unicode(s) for s in subject]) |
| 296 | + subject = ", ".join([safe_text(s) for s in subject]) |
297 | 297 | else: |
298 | 298 | subject = nosubject |
299 | 299 |
|
@@ -489,7 +489,7 @@ def get_mail_text(self, fields, request, context): |
489 | 489 | getattr(self, "gpg_keyid", False) and "plain" or self.body_type or "html" |
490 | 490 | ) |
491 | 491 | mime_text = MIMEText( |
492 | | - safe_unicode(body).encode(email_charset, "replace"), |
| 492 | + safe_text(body).encode(email_charset, "replace"), |
493 | 493 | _subtype=subtype, |
494 | 494 | _charset=email_charset, |
495 | 495 | ) |
|
0 commit comments