From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: unhex org-link for shell command Date: Wed, 17 Jan 2018 17:55:22 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1c1b4051e4c80562f5dabb" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebkRs-0007AA-4n for emacs-orgmode@gnu.org; Wed, 17 Jan 2018 04:56:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebkRm-0000oR-9A for emacs-orgmode@gnu.org; Wed, 17 Jan 2018 04:56:00 -0500 Received: from mail-ot0-x233.google.com ([2607:f8b0:4003:c0f::233]:37592) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebkRm-0000o7-4E for emacs-orgmode@gnu.org; Wed, 17 Jan 2018 04:55:54 -0500 Received: by mail-ot0-x233.google.com with SMTP id a24so16302713otd.4 for ; Wed, 17 Jan 2018 01:55:53 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Org-mode --94eb2c1c1b4051e4c80562f5dabb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm developing an Emacs package https://github.com/stardiviner/org-send-ebook . I found Org-mode hex spaces in filename with "%20", So I reverse this with function `(url-unhex-string (org-element-property :path (org-element-context)))`. But this only works for English filename. If it is Chinese filename. this will caused error. Is there Org-mode built-in function which return the file path with out hexing spaces '%20' ? Or Does Emacs has functions can unhex '%20' correctly on Chinese? Here is the test case: org link: [[file:Data/Books/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi][=E6=80=8E=E6= =A0=B7=E8=AF=BB=E4=B9=A6 (mobi)]] And there is the result of `(org-element-property :path (org-element-context))`: "Data/Books/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi" [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --94eb2c1c1b4051e4c80562f5dabb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm developing an Emacs package https://github.com/stardiviner/org-send= -ebook .
I found Org-mode hex spaces in filename with "%20&qu= ot;, So I reverse this with function `(url-unhex-string (org-element-proper= ty :path (org-element-context)))`. But this only works for English filename= . If it is Chinese filename. this will caused error.

Is ther= e Org-mode built-in function which return the file path with out hexing spa= ces '%20' ?
Or Does Emacs has functions can unhex '%20'= ; correctly on Chinese?

Here is the test case:
org li= nk:
[[file:Data/Books/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi][= =E6=80=8E=E6=A0=B7=E8=AF=BB=E4=B9=A6 (mobi)]]
And there is the result = of `(org-element-property :path (org-element-context))`:
"Data/Bo= oks/%E6%80%8E%E6%A0%B7%E8%AF%BB%E4%B9%A6.mobi"

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID= : 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF= 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>
--94eb2c1c1b4051e4c80562f5dabb--