[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1121] trunk



Revision: 1121
          http://svn.sourceforge.net/ledger-smb/?rev=1121&view=rev
Author:   tetragon
Date:     2007-04-28 20:00:44 -0700 (Sat, 28 Apr 2007)

Log Message:
-----------
Set database connections to utf8

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB/RESTXML/Handler.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/LedgerSMB/User.pm
    trunk/LedgerSMB.pm
    trunk/import_members.pl
    trunk/utils/notify_short/listener.pl

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/LedgerSMB/Form.pm	2007-04-29 03:00:44 UTC (rev 1121)
@@ -1581,6 +1581,7 @@
     my $dbh = DBI->connect( $myconfig->{dbconnect},
         $myconfig->{dbuser}, $myconfig->{dbpasswd} )
       or $self->dberror;
+    $dbh->{pg_enable_utf8} = 1;
 
     # set db options
     if ( $myconfig->{dboptions} ) {
@@ -1600,6 +1601,7 @@
         $myconfig->{dbconnect}, $myconfig->{dbuser},
         $myconfig->{dbpasswd}, { AutoCommit => 0 }
     ) or $self->dberror;
+    $dbh->{pg_enable_utf8} = 1;
 
     # set db options
     if ( $myconfig->{dboptions} ) {

Modified: trunk/LedgerSMB/RESTXML/Handler.pm
===================================================================
--- trunk/LedgerSMB/RESTXML/Handler.pm	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/LedgerSMB/RESTXML/Handler.pm	2007-04-29 03:00:44 UTC (rev 1121)
@@ -124,6 +124,7 @@
     my $dbh = DBI->connect( $myconfig->{dbconnect},
         $myconfig->{dbuser}, $myconfig->{dbpasswd} )
       or carp "Error connecting to the db :$DBI::errstr";
+    $dbh->{pg_enable_utf8} = 1;
 
     return $dbh;
 }

Modified: trunk/LedgerSMB/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/LedgerSMB/Sysconfig.pm	2007-04-29 03:00:44 UTC (rev 1121)
@@ -125,6 +125,7 @@
         $form = new Form;
         $form->error("No GlobalDBH Configured or Could not Connect");
     }
+    $GLOBALDBH->{pg_enable_utf8} = 1;
 }
 
 # These lines prevent other apps in mod_perl from seeing the global db

Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/LedgerSMB/User.pm	2007-04-29 03:00:44 UTC (rev 1121)
@@ -196,6 +196,7 @@
           DBI->connect( $myconfig{dbconnect}, $myconfig{dbuser},
             $myconfig{dbpasswd} )
           or $self->error( __FILE__ . ':' . __LINE__ . ': ' . $DBI::errstr );
+        $dbh->{pg_enable_utf8} = 1;
 
         # we got a connection, check the version
         my $query = qq|
@@ -263,6 +264,7 @@
     my $dbh =
       DBI->connect( $self->{dbconnect}, $self->{dbuser}, $self->{dbpasswd} )
       or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_encode_utf8} = 1;
 
     my $query = qq|
 		SELECT count(*) FROM recurring
@@ -319,6 +321,7 @@
     my $dbh =
       DBI->connect( $form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd} )
       or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_enable_utf8} = 1;
 
     if ( $form->{dbdriver} eq 'Pg' ) {
 
@@ -337,6 +340,7 @@
                   DBI->connect( $form->{dbconnect}, $form->{dbuser},
                     $form->{dbpasswd} )
                   or $form->dberror( __FILE__ . ':' . __LINE__ );
+                $dbh->{pg_enable_utf8} = 1;
 
                 $query = qq|
 					SELECT tablename FROM pg_tables
@@ -380,6 +384,7 @@
           DBI->connect( $form->{dbconnect}, $form->{dbsuperuser},
             $form->{dbsuperpasswd} )
           or $form->dberror( __FILE__ . ':' . __LINE__ );
+        $superdbh->{pg_enable_utf8} = 1;
         my $query = qq|$dbcreate{$form->{dbdriver}}|;
         $superdbh->do($query)
           || $form->dberror( __FILE__ . ':' . __LINE__ . $query );
@@ -394,11 +399,13 @@
     my $dbh =
       DBI->connect( $form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd} )
       or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_enable_utf8} = 1;
     if ( $form->{dbsuperuser} ) {
         my $superdbh =
           DBI->connect( $form->{dbconnect}, $form->{dbsuperuser},
             $form->{dbsuperpasswd} )
           or $form->dberror( __FILE__ . ':' . __LINE__ );
+        $superdbh->{pg_enable_utf8} = 1;
 
         # JD: We need to check for plpgsql,
         # if it isn't there create it, if we can't error
@@ -470,6 +477,7 @@
     my $dbh =
       DBI->connect( $form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd} )
       or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_enable_utf8} = 1;
     my $query = qq|DROP DATABASE "$form->{db}"|;
     $dbh->do($query) || $form->dberror( __FILE__ . ':' . __LINE__ . $query );
 
@@ -526,6 +534,7 @@
     my $dbh =
       DBI->connect( $form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd} )
       or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_enable_utf8} = 1;
 
     if ( $form->{dbdriver} =~ /Pg/ ) {
 
@@ -548,6 +557,7 @@
               DBI->connect( $form->{dbconnect}, $form->{dbuser},
                 $form->{dbpasswd} )
               or $form->dberror( __FILE__ . ':' . __LINE__ );
+            $dbh->{pg_enable_utf8};
 
             $query = qq|
 				SELECT tablename 
@@ -613,6 +623,7 @@
             $form->{dbconnect}, $form->{dbuser},
             $form->{dbpasswd}, { AutoCommit => 0 }
         ) or $form->dberror( __FILE__ . ':' . __LINE__ );
+        $dbh->{pg_enable_utf8} = 1;
 
         # check version
         $query = qq|
@@ -842,6 +853,7 @@
             $self->{dbconnect}, $self->{dbuser},
             $self->{dbpasswd}, { AutoCommit => 0 }
         ) or $self->error($DBI::errstr);
+        $dbh->{pg_enable_utf8} = 1;
 
         # add login to employees table if it does not exist
         my $login = $self->{login};
@@ -895,6 +907,7 @@
         $form->{dbconnect}, $form->{dbuser},
         $form->{dbpasswd}, { AutoCommit => 0 }
     ) or $form->dberror( __FILE__ . ':' . __LINE__ );
+    $dbh->{pg_enable_utf8} = 1;
 
     my $login = $form->{login};
     $login =~ s/@.*//;

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/LedgerSMB.pm	2007-04-29 03:00:44 UTC (rev 1121)
@@ -490,6 +490,7 @@
     ) or $self->dberror;
 
     $dbh->{pg_server_prepare} = 0;
+    $dbh->{pg_enable_utf8} = 1;
 
     if ( $myconfig->{dboptions} ) {
         $dbh->do( $myconfig->{dboptions} );

Modified: trunk/import_members.pl
===================================================================
--- trunk/import_members.pl	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/import_members.pl	2007-04-29 03:00:44 UTC (rev 1121)
@@ -234,6 +234,7 @@
             $self->{dbconnect}, $self->{dbuser},
             $self->{dbpasswd}, { AutoCommit => 0 }
         ) or $self->error($DBI::errstr);
+        $dbh->{pg_enable_utf8} = 1;
 
         # add login to employee table if it does not exist
         my $login = $self->{login};

Modified: trunk/utils/notify_short/listener.pl
===================================================================
--- trunk/utils/notify_short/listener.pl	2007-04-29 02:13:15 UTC (rev 1120)
+++ trunk/utils/notify_short/listener.pl	2007-04-29 03:00:44 UTC (rev 1121)
@@ -23,6 +23,7 @@
         RaiseError => 1,
     }
 );
+$dbh->{pg_enable_utf8} = 1;
 
 my $sth;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.