From 2c032bce43e3908b8758c558e3a1bff8f761ba7b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 19 May 2020 12:02:55 +0530 Subject: [PATCH] Add setlocale to mb_search --- api/v1/Location.php | 1 + 1 file changed, 1 insertion(+) diff --git a/api/v1/Location.php b/api/v1/Location.php index 977556a..f2b91d8 100644 --- a/api/v1/Location.php +++ b/api/v1/Location.php @@ -71,6 +71,7 @@ public function getCities(string $countryName, string $search = NULL) */ public function mb_search(string $haystack, string $needle) { + setlocale(LC_ALL, 'en_US.UTF8'); $haystack = preg_replace('/[\'^`~\"]/', '', iconv('UTF-8', 'ASCII//TRANSLIT', $haystack)); $needle = preg_replace('/[\'^`~\"]/', '', iconv('UTF-8', 'ASCII//TRANSLIT', $needle)); return mb_stripos($haystack, $needle);