- don't croak on malformed utf-8, just log it so we can fix it


git-svn-id: svn://10.0.0.236/trunk@239064 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ccooper%deadsquid.com
2007-11-09 16:35:45 +00:00
parent b33b71e595
commit 7c2ede6f6e

View File

@@ -226,6 +226,13 @@ sub AUTOLOAD {
return $self->$col(@args);
}
sub _log {
my ($self, $message, %info) = @_;
binmode(STDERR,':utf8');
print STDERR "$message";
return;
}
# DBI error handler for SQL errors:
sub _croak {
my ($self, $message, %info) = @_;
@@ -315,7 +322,7 @@ sub utf8_columns {
# the process. Turn the bit off again.
Encode::_utf8_off($self->{$_});
# ..and die
$self->_croak("Invalid UTF8 from database in column '$_'");
$self->_log("Invalid UTF8 from database in column '$_': " . $self->{$_});
}
}
}