From ebaa34424b6c6b144d42a75c341250dc8ba282bb Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 12 Nov 2012 11:40:34 -0500 Subject: [PATCH] Added Unicode normalization to Clickatell class. --- module/VuFind/src/VuFind/SMS/Clickatell.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/VuFind/src/VuFind/SMS/Clickatell.php b/module/VuFind/src/VuFind/SMS/Clickatell.php index 26a95ee2453..1c393421d00 100644 --- a/module/VuFind/src/VuFind/SMS/Clickatell.php +++ b/module/VuFind/src/VuFind/SMS/Clickatell.php @@ -67,6 +67,10 @@ class Clickatell extends AbstractBase if (!function_exists('iconv')) { throw new MailException('Clickatell requires iconv PHP extension.'); } + // Normalize UTF-8 if intl extension is installed: + if (class_exists('Normalizer')) { + $message = \Normalizer::normalize($message); + } $message = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $message); // We need to trim to 160 bytes (note that we need to use substr and not -- GitLab