X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIconv.pm;h=19b8ca169839cb8eb90fd8b3f0c6974b61264f48;hb=9a7a811d2d254f95f3cf1664566ff4a5335eee31;hp=d6ea0cbdf1202e2d6ef3fdb2be4b9d7a15513250;hpb=cd01768df066d55624b63576d1cb7fd122ab4758;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 {