diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/Form.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 7dbb0451..e789ed57 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -141,7 +141,7 @@ sub escape { $str = $self->escape( $str, 1 ) if $1 == 0 && $2 < 44; } - $str = utf8::encode('utf8', $str); + utf8::encode($str); $str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge; $str; @@ -153,8 +153,9 @@ sub unescape { $str =~ tr/+/ /; $str =~ s/\\$//; + utf8::encode($str) if utf8::is_utf8($str); $str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg; - $str = utf8::decode('utf8', $str) unless utf8::is_utf8($str); + utf8::decode($str); $str =~ s/\r?\n/\n/g; $str; |