从 Postgres 9.1.2 升级到 Postgres 9.4beta1 后,OTRS 3.3.5 停止工作,在 http-error.log 中发现 Perl 错误,在关闭工单时引发。错误是:
Wide character in subroutine entry at [...]/Kernel/System.DB.pm line 499
第 499 行如下:
if ( !$Self->{dbh}->do( $Param{SQL}, undef, @Array ) ) {
似乎 Perl 脚本在执行查询时失败。
我的 Perl 版本是 v5.16.3。
我搜索了很多,但到目前为止没有任何解决方案对我有用。
最佳答案
这是警告而不是错误。查看 perldiag 为我们提供了解释。
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.
您有 utf8 编码的字符,Perl 期望在其中看到字节。您可能需要对数据进行
encode()
,然后才能达到这一点。
关于perl - Postgres 9.4beta1 上的 otrs 子程序条目中的宽字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27503182/