mochi / egeoip

Erlang IP Geolocation module, currently supporting the MaxMind GeoLite City Database.
Other
95 stars 57 forks source link

Region code is not always a binary string. #3

Closed lpgauth closed 13 years ago

lpgauth commented 13 years ago

Region code is sometime returned as an integer?

egeoip:lookup("247.253.22.96").
{ok,{geoip,"CG","COG","Congo", <<16>>, <<>>,<<>>,-27.0,133.0,0,0}}

From http://www.maxmind.com/app/city, region should be char(2)...

State/Region    
char(2) 
For US/Canada, ISO-3166-2 code for the state/province name, with the addition of AA, AE, and AP for Armed Forces America, Europe and Pacific. Outside of the US and Canada, FIPS 10-4 code. Region name lookups are available in selected APIs
etrepum commented 13 years ago

Which database exactly are you using? I can't reproduce with the one I have on this workstation.

lpgauth commented 13 years ago

Seems I was using an old geolite database... I switched to what we use in production and I can't reproduce anymore.