summaryrefslogtreecommitdiff
path: root/rc/bin
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-10-05 23:14:23 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-10-05 23:14:23 +0200
commit4af54089530023c4f8e704fbbb0921c13c7bd4fd (patch)
tree59ba7a55d4b865342cd65e5a783fe7a235fccfd7 /rc/bin
parent0c93da13aeda2337f1e7a81f8793bca52887c741 (diff)
replace urlencode with c version that isnt broken for utf-8
Diffstat (limited to 'rc/bin')
-rwxr-xr-xrc/bin/urlencode36
1 files changed, 0 insertions, 36 deletions
diff --git a/rc/bin/urlencode b/rc/bin/urlencode
deleted file mode 100755
index a23359328..000000000
--- a/rc/bin/urlencode
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/awk -f
-BEGIN {
-# We assume an awk implementation that is just plain dumb.
-# We will convert an character to its ASCII value with the
-# table ord[], and produce two-digit hexadecimal output
-# without the printf("%02X") feature.
-
-EOL = "%0A" # "end of line" string (encoded)
-split ("1 2 3 4 5 6 7 8 9 A B C D E F", hextab, " ")
-hextab [0] = 0
-for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0
-}
-{
-encoded = ""
-for ( i=1; i<=length ($0); ++i ) {
- c = substr ($0, i, 1)
- if ( c ~ /[a-zA-Z0-9.-]/ ) {
- encoded = encoded c # safe character
- } else if ( c == " " ) {
- encoded = encoded "+" # special handling
- } else {
- # unsafe character, encode it as a two-digit hex-number
- lo = ord [c] % 16
- hi = int (ord [c] / 16);
- encoded = encoded "%" hextab [hi] hextab [lo]
- }
-}
-if ( EncodeEOL ) {
- printf ("%s", encoded EOL)
-} else {
- print encoded
-}
-}
-END {
- #if ( EncodeEOL ) print ""
-}