emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: [patch] url-hexify-string does not follow W3C spec]


From: Thien-Thi Nguyen
Subject: Re: address@hidden: [patch] url-hexify-string does not follow W3C spec]
Date: 31 Jul 2006 16:49:19 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"David Smith" <address@hidden> writes:

> Nguyen, is this as easy to implement as it sounds?

i don't know how easy it sounds.  that depends on each listener.
to me, it seems very easy to implement, because it is already done.
here is the function as it stands in lisp/url/url-util.el:

(defun url-hexify-string (string)
  "Return a new string that is STRING URI-encoded.
First, STRING is converted to utf-8, if necessary.  Then, for each
character in the utf-8 string, those found in `url-unreserved-chars'
are left as-is, all others are represented as a three-character
string: \"%\" followed by two lowercase hex digits."
  (mapconcat (lambda (char)
               (if (memq char url-unreserved-chars)
                   (char-to-string char)
                 (format "%%%02x" char)))
             (encode-coding-string string 'utf-8 t)
             ""))

i suggest we leave it alone.

btw, i missed some of this thread so i assume "it" refers
to `url-hexify-string'.  if discussion is actually about some
other function (that calls `url-hexify-string'), i have no
opinion on those matters.

thi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]