On Wed, Mar 19, 2008 at 07:32:27AM -0700, Bill Moseley wrote:
>
> unless ( Encode::is_utf8( $c->response->body ) ) {
> return $c->NEXT::finalize;
> }
BTW Jonathan, I realize we are talking past each other on this a bit.
This isn't the issue I originally posted about (decoding), b
On Wed, Mar 19, 2008 at 12:36:42AM -0500, Jonathan Rockway wrote:
> * On Wed, Mar 19 2008, Jonathan Rockway wrote:
>
> > We should not need to check the flag. The incoming data should be
> > encoded. Then we should decode it. Then we should not try to decode it
> > again.
>
> A key thing I for
Well, if is_utf8($c->req->param($foo)) returns true, it surely means
the string was already decoded. But even if is_utf8 returns false it
*might not mean* that the string was not decoded.
And that's the most annoying part.
my $foo = "bar"; # all ascii
utf8::decode($foo);
utf8::is_utf8($foo
* On Wed, Mar 19 2008, Jonathan Rockway wrote:
> We should not need to check the flag. The incoming data should be
> encoded. Then we should decode it. Then we should not try to decode it
> again.
A key thing I forgot to mention is that "is_utf8" doesn't mean "we tried
to decode this already".
* On Tue, Mar 18 2008, Bill Moseley wrote:
> 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
>
On Wed, Mar 19, 2008 at 12:04:37AM +, Jonas Alves wrote:
> >
>
> No, you never should check the flag. See Miyagawa's post
> http://use.perl.org/~miyagawa/journal/35700.
You quoted the entire message -- what point where you commenting on.
--
Bill Moseley
[EMAIL PROTECTED]
_
On Tue, Mar 18, 2008 at 11:01 AM, Bill Moseley <[EMAIL PROTECTED]> wrote:
> 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
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 ch
* 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) ? @{$valu
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($_);
10 matches
Mail list logo