Skip to content

Commit

Permalink
provider: MaxMindBinary: replace utf8_encode with mb_convert_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kornrunner committed May 16, 2024
1 parent fec6f49 commit ef240ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Provider/MaxMindBinary/MaxMindBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public function geocodeQuery(GeocodeQuery $query): Collection
Address::createFromArray([
'providedBy' => $this->getName(),
'countryCode' => $geoIpRecord->country_code,
'country' => null === $geoIpRecord->country_name ? null : utf8_encode($geoIpRecord->country_name),
'country' => null === $geoIpRecord->country_name ? null : mb_convert_encoding($geoIpRecord->country_name, 'UTF-8', 'ISO-8859-1'),
'adminLevels' => $adminLevels,
'locality' => null === $geoIpRecord->city ? null : utf8_encode($geoIpRecord->city),
'locality' => null === $geoIpRecord->city ? null : mb_convert_encoding($geoIpRecord->city, 'UTF-8', 'ISO-8859-1'),
'latitude' => $geoIpRecord->latitude,
'longitude' => $geoIpRecord->longitude,
'postalCode' => $geoIpRecord->postal_code,
Expand Down
1 change: 1 addition & 0 deletions src/Provider/MaxMindBinary/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"require": {
"php": "^8.0",
"ext-mbstring": "*",
"geoip/geoip": "^1.17",
"willdurand/geocoder": "^4.0"
},
Expand Down

0 comments on commit ef240ed

Please sign in to comment.