X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIconv.pm;h=19b8ca169839cb8eb90fd8b3f0c6974b61264f48;hb=feacad49259a8288edefa4c771fc028dd6380ca0;hp=d6ea0cbdf1202e2d6ef3fdb2be4b9d7a15513250;hpb=470a8fa1710b22e2b381eef4cacb01bebaeff725;p=kivitendo-erp.git diff --git a/SL/Iconv.pm b/SL/Iconv.pm index d6ea0cbdf..19b8ca169 100644 --- a/SL/Iconv.pm +++ b/SL/Iconv.pm @@ -37,7 +37,10 @@ sub convert { $to_charset ||= Common::DEFAULT_CHARSET; my $converter = _get_converter($from_charset, $to_charset); - return $converter->convert($text); + $text = $converter->convert($text); + $text = decode("utf-8-strict", $text) if ($to_charset =~ m/^utf-?8$/i) && !Encode::is_utf8($text); + + return $text; } sub _convert {