# conversion works, fine; if not, assume it's because the
# string was already UTF-8, so use it as is.
my $val = $conn->option($opt);
# conversion works, fine; if not, assume it's because the
# string was already UTF-8, so use it as is.
my $val = $conn->option($opt);
- my $maybe = $conv->convert($val);
- if (defined $conv->retval() && $maybe ne $val) {
+ Text::Iconv->raise_error(1);
+ my $maybe;
+ eval {
+ $maybe = $conv->convert($val);
+ }; if (!$@ && $maybe ne $val) {