From 846ccc5e1eeffa1dcf9582393e0251b341e951be Mon Sep 17 00:00:00 2001
From: sunil <esunil.pawar@gmail.com>
Date: Thu, 30 Jun 2016 17:15:50 +0530
Subject: [PATCH] added testcase to verify utf-8 string

---
 tests/phpunit/CRM/Utils/StringTest.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/phpunit/CRM/Utils/StringTest.php b/tests/phpunit/CRM/Utils/StringTest.php
index bd71876df0..93e6ab69c3 100644
--- a/tests/phpunit/CRM/Utils/StringTest.php
+++ b/tests/phpunit/CRM/Utils/StringTest.php
@@ -86,6 +86,10 @@ class CRM_Utils_StringTest extends CiviUnitTestCase {
     foreach ($cases as $input => $expected) {
       $this->assertEquals($expected, CRM_Utils_String::ellipsify($input, $maxLen));
     }
+    // test utf-8 string, CRM-18997
+    $input = 'Registro de eventos on-line: Taller: "Onboarding - Cómo integrar exitosamente a los nuevos talentos dentro de su organización - Formación práctica."';
+    $maxLen = 128;
+    $this->assertEquals(true, mb_check_encoding(CRM_Utils_String::ellipsify($input, $maxLen), 'UTF-8'));
   }
 
   public function testRandom() {
-- 
2.25.1