summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
}