Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 86305
Status: rejected
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.08250
Fixed in: (no value)



Subject: console trace "Wide character in print"
Download (untitled) / with headers
text/plain 503b
DBIx::Class::Storage::Statistics::print generates the warning "Wide character in print at …/IO/Handle.pm line 417." when debugging with DBIC_TRACE=1 DBIC_TRACE_PROFILE=console and there's Unicode text in the SQL query. The message is passed through print unencoded, which is wrong. Adding `use Encode::Locale; binmode $self->debugfh, ':encoding(console_out)';` to this method works for me, but certainly you'll know a more appropriate place to add the encoding layer, e.g. when the handle is created.
Download (untitled) / with headers
text/plain 1006b
On Fri Jun 21 10:48:04 2013, DAXIM wrote: Show quoted text
> DBIx::Class::Storage::Statistics::print generates the warning "Wide > character in print at …/IO/Handle.pm line 417." when debugging with > DBIC_TRACE=1 DBIC_TRACE_PROFILE=console and there's Unicode text in > the SQL query. > > The message is passed through print unencoded, which is wrong. Adding > `use Encode::Locale; binmode $self->debugfh, > ':encoding(console_out)';` to this method works for me, but certainly > you'll know a more appropriate place to add the encoding layer, e.g. > when the handle is created.
I thought a lot about this ticket and am going to reject it. Setting aside the question whether it is "wrong" to print to a filehandle using its default settings, there is a practical problem with your suggestion. If we *do* set unicode mode on STDOUT, we will start seeing exceptions when DBIC attempts to output plain-high-byte-latin (say from Win1252 columns). It is not acceptable for the trace code to introduce its own exceptions.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.