Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HashRefInflator that knows about utf8
package BUX::DB::HashRefInflator;
use strict;
use warnings;
use utf8;
use parent qw( DBIx::Class::ResultClass::HashRefInflator );
sub inflate_result {
my ( $self, @args ) = @_;
my $res = $self->SUPER::inflate_result( @args );
$res = {
map {
my $val = $res->{$_};
utf8::decode($val) if defined $val && !ref($val);
( $_ => $val );
} keys %$res
} if ref($res) eq 'HASH';
return $res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.