X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIconv.pm;h=aba271a0a226d7d03bc7f1cdda949bc9165a1769;hb=991369b17d679e2855f4d5086d0b9769dc2ae1aa;hp=d6ea0cbdf1202e2d6ef3fdb2be4b9d7a15513250;hpb=7f34b3c1f69619eaf3c41945ab22cf21883bb945;p=kivitendo-erp.git diff --git a/SL/Iconv.pm b/SL/Iconv.pm index d6ea0cbdf..aba271a0a 100644 --- a/SL/Iconv.pm +++ b/SL/Iconv.pm @@ -33,11 +33,14 @@ sub convert { my ($from_charset, $to_charset, $text) = @_; - $from_charset ||= Common::DEFAULT_CHARSET; - $to_charset ||= Common::DEFAULT_CHARSET; + $from_charset ||= 'UTF-8'; + $to_charset ||= 'UTF-8'; 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 {