Subject: | DBD::JDBC ignores the internal Perl utf8 flag |
Perl strings can be internally encoded as latin1 or utf8; an internal
flag makes the difference, but it's supposed to be transparent for
programmers. So the DBD::JDBC should look a the flag and convert data
appropriately before sending it to the jdbc proxy server.
Ex.
# string with internal representation latin1
my $latin1 = "il était une bergère";
# string with internal representation utf8, correctly flagged
my $utf8 = $latin1;
utf8::upgrade($utf8);
# string with internal representation utf8, but without the flag
my $raw_utf8 = $latin1;
utf8::encode($raw_utf8);
On the Perl side, we have $latin1 eq $utf8 and $latin1 ne $raw_utf8.
But on the database side, after inserting those 3 values, we have
$latin1 ne $utf8 and $utf8 eq $raw_utf8.
This is a problem when the data to be sent to the database comes from
various sources like HTTP, JSON, YAML, XML, etc. because some modules
convert everything to utf8, some others don't, and the programmer is not
supposed to care about those differences.