X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/cd01768df066d55624b63576d1cb7fd122ab4758..7cd6d451d97d1f1e7f3c0f9db2de03735dc8c8f0:/SL/Iconv.pm 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 {