Subject: | Wide character in print while using DBIC_TRACE=1 |
There is a warning on the console when running an application under
these conditions:
- standalone server
- DBIC_TRACE=1 tracing
- "warnings: 0" in environments/development.yml
- i update some data in DB with unicode character (in my case euro sign)
Under these conditions the SQL statement gets printed to the console
(STDERR):
UPDATE `group` SET `name` = ? WHERE ( `id` = ? ): 'Switch -2,97 €', '17'
and it produces the warning:
Wide character in print at
/home/ico/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2/i686-linux/IO/Handle.pm
line 406.
The warning isn't produced if:
- DBIC_TRACE=1 tracing is not used and no SQL is printed to console
- or no unicode characters are saved and printed to console
My connection to DB and all data is in UTF8. Connection to DB is via
DBIx::Class like this:
$::schema = App::DB->connect(
"DBI:mysql:database=$DB", $login, $pass,
{
on_connect_do => "set names utf8;",
mysql_enable_utf8 => 1,
}
);
Settings in config.yml:
log: "core"
layout: "main"
logger: "file"
charset: "UTF-8"
template: template_toolkit
engines:
template_toolkit:
start_tag: '[%'
stop_tag: '%]'
EVAL_PERL: "1"
UNICODE: "1"
ENCODING: "utf8"
My envoronment:
Dancer:
$ perl -MDancer -e 'print $Dancer::VERSION;'
1.1999_02
perl:
$ perl -V
Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
Platform:
osname=linux, osvers=2.6.34-i1-smp, archname=i686-linux
uname='linux puding 2.6.34-i1-smp #1 smp thu may 27 16:30:13 cest
2010 i686 intel(r) core(tm) i5 cpu m 520 @ 2.40ghz genuineintel gnulinux '
config_args='-de -Dprefix=/home/ico/perl5/perlbrew/perls/perl-5.12.2'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
ccversion='', gccversion='4.4.4', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.11.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
Built under linux
Compiled at Nov 4 2010 22:35:11
%ENV:
PERLBREW_PATH="/home/ico/perl5/perlbrew/bin:/home/ico/perl5/perlbrew/perls/perl-5.12.2/bin"
PERLBREW_PERL="perl-5.12.2"
PERLBREW_ROOT="/home/ico/perl5/perlbrew"
PERLBREW_VERSION="0.12"
@INC:
/home/ico/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/i686-linux
/home/ico/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2
/home/ico/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2/i686-linux
/home/ico/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2
.
OS:
slackware 13.1
$ uname -a
Linux puding 2.6.34-i1-smp #1 SMP Thu May 27 16:30:13 CEST 2010 i686
Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz GenuineIntel GNU/Linux
DB:
$ mysql --version
mysql Ver 14.14 Distrib 5.1.46, for slackware-linux-gnu (i486) using
readline 5.1