* url-decode-url missing
@ 2019-11-03 21:12 Juri Linkov
2019-11-03 22:17 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2019-11-03 21:12 UTC (permalink / raw)
To: emacs-devel
There is 'url-encode-url' in lisp/url/url-util.el, but
no inverse function with the expected name 'url-decode-url'.
There is a pair of url-hexify-string/url-unhex-string,
and it seems url-unhex-string does something like decoding,
but its output is garbled text. For example:
(let ((url "https://en.wiktionary.org/wiki/Ω"))
(string-equal url (url-unhex-string (url-encode-url url))))
=> nil
Using decode-coding-string doesn't help either:
(let ((url "https://en.wiktionary.org/wiki/Ω"))
(string-equal url (decode-coding-string
(url-unhex-string (url-encode-url url))
'utf-8)))
=> nil
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: url-decode-url missing
2019-11-03 21:12 url-decode-url missing Juri Linkov
@ 2019-11-03 22:17 ` Andreas Schwab
2019-11-03 22:33 ` Juri Linkov
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2019-11-03 22:17 UTC (permalink / raw)
To: Juri Linkov; +Cc: emacs-devel
On Nov 03 2019, Juri Linkov wrote:
> Using decode-coding-string doesn't help either:
>
> (let ((url "https://en.wiktionary.org/wiki/Ω"))
> (string-equal url (decode-coding-string
> (url-unhex-string (url-encode-url url))
> 'utf-8)))
> => nil
That works for me.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: url-decode-url missing
2019-11-03 22:17 ` Andreas Schwab
@ 2019-11-03 22:33 ` Juri Linkov
0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2019-11-03 22:33 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel
>> Using decode-coding-string doesn't help either:
>>
>> (let ((url "https://en.wiktionary.org/wiki/Ω"))
>> (string-equal url (decode-coding-string
>> (url-unhex-string (url-encode-url url))
>> 'utf-8)))
>> => nil
>
> That works for me.
Thanks for trying. I didn't expect that the result would be different
in 'emacs -Q'. I'll investigate what is wrong in configuration
(and this is not a bug report).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-03 22:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-03 21:12 url-decode-url missing Juri Linkov
2019-11-03 22:17 ` Andreas Schwab
2019-11-03 22:33 ` Juri Linkov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).