Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] SQLSource encoding

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Guillaume Rousse <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] SQLSource encoding
  • Date: Thu, 25 Jul 2013 15:58:24 +0200

Le 25/07/2013 15:48, David Verdin a écrit :
Hi,

I'm merging SQLSource to Sympa::Datasource::SQL (the problem will be the
same in Sympa::Database).

Problem: In the 6.2 branch, Soji added the enforcement of the UTF-8
encoding on the client side for all supported engines. It was done in
the "establish_connection" sub. Now, in SQL.pm, we only have a "connect"
sub with no part related to a given RDBMS.The sub modules for each RDBMS
don't have a "connect" sub. So where can we enforce UTF-8 usage? Can we
create an "enforce_utf8" sub in each module, which will be called in the
SQL::connect?
You probably didn't found thqem, but both Sympa::Datasource::SQL::SQLite and Sympa::Datasource::SQL::Sybase override the definition of connect() method for database-specific processing.

Here is Sybase case, for instance:

sub connect {
my ($self, %params) = @_;

my $result = $self->SUPER::connect(%params);
return unless $result;

$self->{dbh}->do("use $self->{db_name}");

return 1;
}

However, regarding the encoding issue, I object doing it unconditionnaly for external datasources, for which there is no garanty about their internal structure. A configuration flag would be useful, tough.

It does make sense for Sympa::Databases subclasses, tough, for which this is enforced in every subclasses.
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page