summaryrefslogtreecommitdiff
path: root/localkannel-dispatch
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-09-28 15:55:53 +0200
committerJonas Smedegaard <dr@jones.dk>2010-09-28 15:55:53 +0200
commit89bf610feb378a6e29a27c0a3dada7dad0260d0f (patch)
tree662c79fe2a5ffb68d570d70e3001eabab0439e1b /localkannel-dispatch
parent559a8bebfbb1868e41ce25e54cc3350a8878fc1c (diff)
Revert "Simplify perl code, and fix handle multiline input in uriunescape()."
This reverts commit 3b41cf4d203767f6d4dd235c9f060db7e5eaa512.
Diffstat (limited to 'localkannel-dispatch')
-rwxr-xr-xlocalkannel-dispatch10
1 files changed, 7 insertions, 3 deletions
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(<STDIN>));'
fi
}