Steps to reproduce:
1) Set visitor ip 78.34.12.20.
2) Open http://domain.tld

Displayed PDOException: in visitors_exit() (line 192 of /home/git/visitors/visitors.exit.inc).

After set db_insert('visitors') to try catch displayed SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF6ln' for column 'visitors_city' at row 1.

Problems with the input of diacritical characters.

GeoIP data for ip 78.34.12.20:

Array
(
[continent_code] => EU
[country_code] => DE
[country_code3] => DEU
[country_name] => Germany
[region] => 07
[city] => K�ln
[postal_code] =>
[latitude] => 50.933300018311
[longitude] => 6.9499998092651
[dma_code] => 0
[area_code] => 0
)

City field have diacritical character.

Comments

gashev’s picture

The geoip database return the cityname in iso-8859-1. For fix this issue I'll add transform iso-8859-1 into the utf8.

$fields['visitors_city'] = utf8_encode($geoip_data['city']);

gashev’s picture

Fixed to 7.x-1.0-alpha7.

gashev’s picture

Fixed to 6.x-1.0-alpha6.

gashev’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.