diff --git a/include/debug.php b/include/debug.php index a0de99f36..af4f29364 100644 --- a/include/debug.php +++ b/include/debug.php @@ -34,6 +34,9 @@ function echo_debug ($file,$line="",$msg="") { $sql= "insert into log (lg_file,lg_line,lg_msg) ". "values ('$file','$line','$msg');"; +// pg_exec ($cn,"\set encoding 'latin1'"); + // echo pg_client_encoding($cn); + pg_set_client_encoding($cn,'latin1'); pg_exec($cn,$sql); } } diff --git a/include/postgres.php b/include/postgres.php index 76b6abe3a..1305bb2af 100644 --- a/include/postgres.php +++ b/include/postgres.php @@ -98,7 +98,9 @@ function DbConnect($p_db=-1,$p_type='dossier') { */ function ExecSql($p_connection, $p_string) { echo_debug(__FILE__,__LINE__,"SQL = $p_string"); - + // probl. with Ubuntu & UTF8 + //---- + pg_set_client_encoding($p_connection,'latin1'); $ret=pg_query($p_connection,$p_string); if ( $ret == false ) { echo_error ("SQL ERROR ::: $p_string");