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 17, 2024
1 parent f31f0a7 commit e325817
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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
3 changes: 2 additions & 1 deletion src/Provider/MaxMindBinary/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"require": {
"php": "^8.0",
"geoip/geoip": "^1.17",
"symfony/polyfill-mbstring": "^1.0",
"willdurand/geocoder": "^4.0"
},
"provide": {
Expand Down Expand Up @@ -42,4 +43,4 @@
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
}
}
}

0 comments on commit e325817

Please sign in to comment.