From 89bf610feb378a6e29a27c0a3dada7dad0260d0f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 28 Sep 2010 15:55:53 +0200 Subject: Revert "Simplify perl code, and fix handle multiline input in uriunescape()." This reverts commit 3b41cf4d203767f6d4dd235c9f060db7e5eaa512. --- localkannel-dispatch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'localkannel-dispatch') diff --git a/localkannel-dispatch b/localkannel-dispatch index a3e46ff..e81c7b2 100755 --- a/localkannel-dispatch +++ b/localkannel-dispatch @@ -24,17 +24,21 @@ grepescape() { # Based on Text::Unidecode bug#8017: http://rt.cpan.org/Ticket/Display.html?id=8017#txn-322351 lctransliterate() { - echo "$1" | perl -MText::Unidecode -MEncode \ + echo "$1" | perl -n \ + -e 'use Text::Unidecode;' \ + -e 'use Encode 2.12 qw(encode decode _utf8_off);' \ -e 'print lc(decode("GSM0338", encode("GSM0338", decode("UTF-8", $_),' \ - -e 'sub {$a=unidecode(chr $_[0]); Encode::_utf8_off($a); $a;}' \ + -e 'sub {$a=unidecode(chr $_[0]); _utf8_off($a); $a;}' \ -e ')));' + + return $res; } uriunescape() { if [ 0 = "$urldecode" ]; then echo "$@" else - echo "$@" | perl -MURI::Escape -ne 'print lc(uri_unescape($_))' + echo "$@" | perl -e 'use URI::Escape; print lc(uri_unescape());' fi } -- cgit v1.2.3