Subject: | connect to network host changes locale |
When doing a connection to a network database, the locale setting is
changed. It doesn't when doing a local connection.
Actually I am not sure wether I should say changed or maybe activated
because it switches from default 'C' to my LANG environment variable.
Anyway this is unexpected and caused bad behaviour to the main code. In
addition it was really very hard to find out where did it comes from.
Here is an example. I insert the output inside the code so you can see
what happens:
#!/usr/bin/perl
use DBI;
use POSIX;
warn setlocale(LC_NUMERIC);
-> *C*
eval { my $dbh= DBI->connect("DBI:mysql"); };
warn setlocale(LC_NUMERIC);
-> *C*
eval { my $dbh= DBI->connect("DBI:mysql:hostname=WHATEVER"); };
warn setlocale(LC_NUMERIC);
-> *ca_ES.UTF-8*
This i perl v5.10.1 on Ubuntu 10.04. I tried some DBI releases, like
1.609 and 1.611.