emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107826: (url-unhex-string): Add


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107826: (url-unhex-string): Add an optional CODING-SYSTEM parameter.
Date: Tue, 10 Apr 2012 09:06:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

> -(defun url-unhex-string (str &optional allow-newlines)
> +(defun url-unhex-string (str &optional allow-newlines coding-system)
>    "Remove %XX embedded spaces, etc in a URL.
>  If optional second argument ALLOW-NEWLINES is non-nil, then allow the
>  decoding of carriage returns and line feeds in the string, which is normally
> -forbidden in URL encoding."
> +forbidden in URL encoding.
> +If CODING-SYSTEM is non-nil, interpret the unhexed string as
> +being encoded in that coding system."
>    (setq str (or str ""))
>    (let ((tmp "")
>       (case-fold-search t))
> @@ -331,7 +333,9 @@
>                   (t (byte-to-string code))))
>             str (substring str (match-end 0)))))
>      (setq tmp (concat tmp str))
> -    tmp))
> +    (if coding-system
> +     (decode-coding-string tmp coding-system)
> +      tmp)))
 
>  (defconst url-unreserved-chars
>    '(

Actually, I'd rather not do that: it's just as easy to call
decode-coding-string manually from the caller.


        Stefan



reply via email to

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