Stefan Monnier wrote: >> Here is a patch against EMACS_22_BASE. >> > > I'd rather use a less arbitrary scheme. E.g. > - only accept unchanged safe chars (rather than rule out > dangerous ones), e.g. [:alnum:] and maybe a couple more. > - everything else encoded following quoted-printable. > > Of course, QP applies to bytes, not to chars, which also points to > a potential problem with [:alnum:] since it includes multibyte chars > which may also be rejected, but I think that would be safe enough for > a start. > OK, here's a revised patch that accepts only ASCII alphanumerics, -, _, ., ~, # and +, and percent encodes all others. It's not strict URL encoding, since multibyte characters will be translated to more than two hex characters, but as far as I can tell the encoding doesn't have to be reversable, just give unique names that don't contain invalid characters, so I think it is good enough. On the trunk it is cheap and easy to convert to utf-8, so we could properly URL encode them there.