[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: function to decode url percent encoding
From: |
Xah Lee |
Subject: |
Re: function to decode url percent encoding |
Date: |
Wed, 08 Dec 2010 15:08:51 -0000 |
User-agent: |
G2/1.0 |
some missing section from my previous post...
I know there's a
(require 'gnus-util)
gnus-url-unhex-string
but that just unhex, and generate gibberish if the url contains
unicode chars.
some study shows that the “%E2%80%93” are hexdecimals E2 80 93, and is
the byte sequence of the en dash char by utf-8 encoding.
So, i guess i could parse the url then interpret the %x string as
utf-8 hex bytes then turn them back to unicode chars. Any idea if
there's built in function that helps this?
Xah
On May 18, 11:12 am, Xah Lee <xah...@gmail.com> wrote:
> is there a function that decode the url percent encoding?
>
> e.g.http://en.wikipedia.org/wiki/Sylvester%E2%80%93Gallai_theorem
>
> should become
>
> http://en.wikipedia.org/wiki/Sylvester–Gallai_theorem
>
> that's a EN DASH, unicode 8211.
>
> but that just unhex, and generate gibberish if the url contain unicode
> chars.
>
> thanks.
>
> Xah
> ∑http://xahlee.org/
>
> ☄