From: superpollo on 22 Jan 2010 10:12 hi. is there a smarter way to do percent decoding (and encoding) other than a mere succession of sed substitutions? bye
From: Seebs on 22 Jan 2010 10:14 On 2010-01-22, superpollo <utente(a)esempio.net> wrote: > hi. > > is there a smarter way to do percent decoding (and encoding) other than > a mere succession of sed substitutions? What do you mean "percent decoding (and encoding)"? You want to convert ratios to percentages? Values not allowed in URLs to ASCII hex codes? printf format strings to output? -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: superpollo on 22 Jan 2010 10:16 Seebs ha scritto: > On 2010-01-22, superpollo <utente(a)esempio.net> wrote: >> hi. >> >> is there a smarter way to do percent decoding (and encoding) other than >> a mere succession of sed substitutions? > > What do you mean "percent decoding (and encoding)"? You want to convert > ratios to percentages? Values not allowed in URLs to ASCII hex codes? > printf format strings to output? > > -s i mean: http://en.wikipedia.org/wiki/Percent-encoding
From: Hallvard B Furuseth on 22 Jan 2010 10:59 superpollo writes: > is there a smarter way to do percent decoding (and encoding) other than > a mere succession of sed substitutions? I don't remember which characters need to be encoded, but for illustration here is a version which encodes all but letters and whitespace. perl -wple 's/([^\w\s])/sprintf("%%%02X", ord($1))/eg' man perlop and man perlfunc describes s//eg and sprintf. -- Hallvard
From: Janis Papanagnou on 22 Jan 2010 11:14 superpollo wrote: > Seebs ha scritto: >> On 2010-01-22, superpollo <utente(a)esempio.net> wrote: >>> hi. >>> >>> is there a smarter way to do percent decoding (and encoding) other >>> than a mere succession of sed substitutions? >> >> What do you mean "percent decoding (and encoding)"? You want to convert >> ratios to percentages? Values not allowed in URLs to ASCII hex codes? >> printf format strings to output? >> >> -s > > i mean: > > > http://en.wikipedia.org/wiki/Percent-encoding What Seebs probably meant: http://catb.org/~esr/faqs/smart-questions.html Janis
|
Next
|
Last
Pages: 1 2 3 4 Prev: Want to obtain single line output based on a file. Next: Simple regex question |