[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV lynx eats spaces in a link
From: |
Benjamin C. W. Sittler |
Subject: |
Re: LYNX-DEV lynx eats spaces in a link |
Date: |
Thu, 20 Mar 1997 21:53:44 -0700 (MST) |
On Thu, 20 Mar 1997, Larry W. Virden, x2487 wrote:
> Anyone know of a command line program that can be given an argument of a link
> and which returns an encoded one? I don't know all the hex codes for
> all the objectionable characters, so I didn't want to hazard a wrong guess.
> In fact, I was hesitant to even reply, since I wasn't sure whether a
> HREF label had the same restrictions and was unable to look it up at the time
> due to rushing off to a meeting.
I take this to mean you want a script which performs the %-hex-hex
encodings. This simple perl command prints the %-hex-hex encodings for
all characters in standard input.
perl -pe 's/./"%".sprintf("%2.2x",ord($&))/ge'
Typical usage might be:
$ echo "filename" | perl -pe 's/./"%".sprintf("%2.2x",ord($&))/ge'
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;