On Tue, Mar 18, 2008 at 03:38:06AM -0500, Jonathan Rockway wrote: > * On Tue, Mar 18 2008, Bill Moseley wrote: > > The plugin decodes all parameters using: > > > > $_ = $c->encoding->decode( $_, $CHECK ) for ( ref($value) ? @{$value} : > > $value ); > > > > > > I'd think it would be wise to check to see if the string is already > > decoded: > > > > for ( ref($value) ? @{$value} : $value ) { > > next if Encode::is_utf8($_); > > $_ = $c->encoding->decode( $_, $CHECK ); > > } > > Never check is_utf8. Encode will do the right thing regardless of > the internal representation of the string. >
This is decoding, not encoding. Without testing is_utf8 and if the parameters are already decoded I rightly get: [error] Caught exception in engine "Cannot decode string with wide characters at /usr/local/share/perl/5.8.8/Catalyst/Plugin/Unicode/Encoding.pm line 74." > http://blog.jrock.us/articles/Fuck%20the%20internal%20representation.pod Yes, checking is_ut8 before encoding doesn't make sense. -- Bill Moseley [EMAIL PROTECTED] _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/