-
Notifications
You must be signed in to change notification settings - Fork 522
[1.7][maxmind] fix provider encondig. Force utf8. #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.7][maxmind] fix provider encondig. Force utf8. #268
Conversation
Why not encode the whole file? This has some performance and memory issues. |
@Baachi could explain how binary file could be encoded? |
Hm this is a good question. I just google the problem and everyone suggest to use |
too many failed tests. I believe it is not me. |
The tests didn't pass because the data from the differend providers has been changed. |
@@ -83,6 +83,12 @@ public function getGeocodedData($address) | |||
'latitude' => $geoIpRecord->latitude, | |||
'longitude' => $geoIpRecord->longitude, | |||
)); | |||
|
|||
$results = array_map(function($value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it works, but i think array_walk_recursive('utf8_encode', $results)
would work too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly saying I copy\pasted it from another Provider.
I dont think we need array_walk_recursive
here as the array created few lines above and it contains scalars.
@willdurand any chance to merged it? |
Do we really need this? |
@willdurand just comment the fix and see how the test would fail |
But the lib should not alter the encoding... |
well, yes in a perfect world. Here it is well known problem. As far as I can see it is the only one solution to get the right info. First I tried to fix encoding in the project code but it appeared to be too late, it simply did not work. Somewhere after Also I found that you did exact same fix in the GeoIpProvider. |
Ah, then I'm screwed! :D So, could you create a |
done - formapro-forks@3c90e66 |
[1.7][maxmind] fix provider encondig. Force utf8.
Great, thanks! |
Tagged |
No description provided.