- my $converter = get_converter($from_charset, $to_charset);
- return $converter->convert($text);
+ my $converter = _get_converter($from_charset, $to_charset);
+ $text = $converter->convert($text);
+ $text = decode("utf-8-strict", $text) if ($to_charset =~ m/^utf-?8$/i) && !Encode::is_utf8($text);
+
+ return $text;