Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Website Question(s)



>>>>> "Lyle" == Lyle Saxon <Lyle> writes:

    Lyle> Matt Gushee wrote:

    >> '%' is the escape character, and the next two characters are
    >> the character code (in UTF-8, if I'm not mistaken). E.g., '%7E'
    >> is the code for '~'.

IIRC, based on the honorable ancestors of RFC-2822, URLs are written
in printable ASCII (ie, no high-bit-set characters, no controls, and
no spaces), and URL encoding is octet oriented---there's no character
set implied.  It's up to the protocol and/or systems to define that.

    Lyle> Thank you very much for this answer.  One more question -
    Lyle> would it be better to set up my links with "%7E" in stead of
    Lyle> "~"?

No.  URL encoding is what is known as a "transport encoding" (like
BASE64 for binary files and quoted-printable for text files that are
mostly ASCII).  In particular, because % is the escape character, any
% in an URL must be escaped by the browser, so your browser will send
%7E7E, and only one layer gets stripped off at the other end.

    Lyle> What I still find strange though, is how I'll click on one
    Lyle> of my links which is set up with the "~" mark, and sometimes
    Lyle> that's exactly what is displayed in the address bar and
    Lyle> other times it's been converted.

The problems is that it's context-dependent, because given a form "%
hex-digit hex-digit" there's no way to know whether it's URL-encoded
just by looking at it.  So the programmer has to keep track of whether
the strings being passed around are "raw" or URL-encoded, and it's
easy to make the mistake of passing an URL-encoded string to a
function that expects and outputs raw strings, and eventually it
propagates to where you can see it.

My guess is that it's a problem at your ISP, which is canonicalizing
or redirecting the apparent URL to a real one, but URL-encoding the
real one too many times.

If you click on the address bar and then hit return (which tries to
fetch the URL in the address bar in most browsers), what happens?


-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links