Skip to content

Commit fec6f49

Browse files
committed
provider: IP2LocationBinary: replace utf8_encode with mb_convert_encoding
1 parent 8a49fa1 commit fec6f49

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Provider/IP2LocationBinary/IP2LocationBinary.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ public function geocodeQuery(GeocodeQuery $query): Collection
8181
Address::createFromArray([
8282
'providedBy' => $this->getName(),
8383
'countryCode' => $records['countryCode'],
84-
'country' => null === $records['countryName'] ? null : utf8_encode($records['countryName']),
84+
'country' => null === $records['countryName'] ? null : mb_convert_encoding($records['countryName'], 'UTF-8', 'ISO-8859-1'),
8585
'adminLevels' => $adminLevels,
86-
'locality' => null === $records['cityName'] ? null : utf8_encode($records['cityName']),
86+
'locality' => null === $records['cityName'] ? null : mb_convert_encoding($records['cityName'], 'UTF-8', 'ISO-8859-1'),
8787
'latitude' => $records['latitude'],
8888
'longitude' => $records['longitude'],
8989
'postalCode' => $records['zipCode'],

src/Provider/IP2LocationBinary/composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"require": {
1515
"php": "^8.0",
16+
"ext-mbstring": "*",
1617
"ip2location/ip2location-php": "^8.1.1",
1718
"willdurand/geocoder": "^4.0"
1819
},

0 commit comments

Comments
 (0)