perl - Postgres 9.4beta1 上的 otrs 子程序条目中的宽字符

标签 perl otrs postgresql-9.4

从 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/

相关文章:

regex - 我可以使用交替将多少个正则表达式链接在一起?

php - 使用 soap api 显示所有 otrs 票

arrays - 如何获取数组的最后 25 项?

mysql - 为什么我的查询以列而不是行的形式返回结果?

Linux 无法识别 perl shebang

perl - OTRS PostmasterMailbox.pl 解析/MIME 类型

mysql - 如何使用 mysqlworkbench 连接到 otrs MySQL 数据库

java.lang.reflect.InvocationTargetException : null 异常

sql - 删除重复值,因为它是 false 或 true

regex - Perl 使用 file2 从 file1 中删除单词