Wide character in subroutine entry in otrs on Postgres 9.4beta1

2.6k Views Asked by At

After upgrading from Postgres 9.1.2 to Postgres 9.4beta1, OTRS 3.3.5 stopped working with a Perl error found in http-error.log, raised when closing a ticket. The error is:

Wide character in subroutine entry at [...]/Kernel/System.DB.pm line 499

The line 499 is the following:

if ( !$Self->{dbh}->do( $Param{SQL}, undef, @Array ) ) {

It seems that the Perl script fails while executing a query.

My Perl version is v5.16.3.

I searched a lot but no solution worked for me so far.

1

There are 1 best solutions below

1
On

This is a warning not an error. Looking in perldiag gives us the explanation.

Wide character in %s

(S utf8) Perl met a wide character (>255) when it wasn't expecting one. This warning is by default on for I/O (like print). The easiest way to quiet this warning is simply to add the :utf8 layer to the output, e.g. binmode STDOUT, ':utf8' . Another way to turn off the warning is to add no warnings 'utf8'; but that is often closer to cheating. In general, you are supposed to explicitly mark the filehandle with an encoding, see open and binmode.

You have utf8-encoded characters where Perl is expecting to see bytes. You probably need to encode() your data before it gets to this point.