Ar an seachtú lá is fiche de mí Márta, scríobh Steve Youngs:
I've now actually taken a look at url-coding.el (beforehand I
only
went as far as the first line) and can honestly say that I have no
idea what it does. :-)
Really--it’s that obscure? Well, to be a bit clearer, it defines a coding
system such that you can do something like:
(setq full-url
(format "http://www.google.com/search?q=%s"
(encode-coding-string "this is our query string &c."
'url-coding)))
=> "http://www.google.com/search?q=this%20is%20our%20query%20string%20%26c."
to generate valid URLs. You can also go in the other direction, which can be
useful when your browser has saved a file to disk without transforming %20
to space:
(decode-coding-string
"Awkward%20file%20name--it%27s%20got%20punctuation%20%2B%20everything.jpg"
'url-coding)
=> "Awkward file name--it's got punctuation + everything.jpg"
The HTTP spec says any byte outside of an extremely limited range must be
encoded as %AB, where AB is the hexadecimal numeric value of that byte, when
that byte is to be passed as a part query string or as part of form
submission data.
It is a toy--I wrote it as part of an effort to better document the CCL
mini-language for writing character encoding transformations. w3 certainly
already has a better version of it, written outside of the CCL framework,
and thus portable to non-Mule. But making it available as part of the
packages does make the documentation better, because it makes it easier for
people to try it out.
So I'll let you decide where to put it. If you feel net-utils
is
appropriate, go ahead and add it.
And it’s looking like we have a new package, mule-misc :-) .
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien