all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: emacs-devel@gnu.org
Subject: Re: fixing url-unhex-string for unicode/multi-byte charsets
Date: Fri, 06 Nov 2020 14:04:40 +0200	[thread overview]
Message-ID: <83pn4q8zdz.fsf@gnu.org> (raw)
In-Reply-To: <20201106102756.e2ctvpjruenatud5@E15-2016.optimum.net> (message from Boruch Baum on Fri, 6 Nov 2020 05:27:56 -0500)

> Date: Fri, 6 Nov 2020 05:27:56 -0500
> From: Boruch Baum <boruch_baum@gmx.com>
> Cc: emacs-devel@gnu.org
> 
> > I made a suggestion in that discussion, I will repeat some of them
> > here:
> 
> Yeah, but they don't work.

I said "something like that", because I don't know the full context.
If "don't work" means "needs minor adaptations", the suggestions are
still valid.

> > So, for file names, something like the below should do the job
> > simpler:
> >
> >   (decode-coding-string (url-unhex-string STR)
> >                         (or file-name-coding-system
> > 			    (default-value 'file-name-coding-system)))
> 
> Try it.

I can't, not in full: I don't have a Freedesktop trash anywhere I have
access to.  I did try the 2 file names you posted, including the one
with Hebrew characters, and it did work for me, on the assumption that
file-name-coding-system is UTF-8.

> To reproduce, touch and then trash a file named some two Hebrew
> words delimited by a space. Navigate to the trash directory's 'info'
> sub-directory and extract the 'path' value from the file's meta-data
> .info file. That's the string we need to decode. Apply the string to
> your solution and see that you do not get the space-delimited two
> Hebrew words.

A stand-alone test case, which doesn't require an actual trash, would
be appreciated, so I could see which parrt doesn't work, and how to
fix it.

Alternatively, maybe you could explain why you needed to insert the
text into a temporary buffer and then extract it from there?  AFAIK,
we have the same primitives that work on decoding strings as we have
for decoding buffer text.



  reply	other threads:[~2020-11-06 12:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  7:47 fixing url-unhex-string for unicode/multi-byte charsets Boruch Baum
2020-11-06  8:02 ` Eli Zaretskii
2020-11-06 10:27   ` Boruch Baum
2020-11-06 12:04     ` Eli Zaretskii [this message]
2020-11-06 12:28       ` Boruch Baum
2020-11-06 13:34         ` Eli Zaretskii
2020-11-06 14:59           ` Stefan Monnier
2020-11-06 15:04             ` Eli Zaretskii
2020-11-08  9:12               ` Boruch Baum
2020-11-08 13:39                 ` Stefan Monnier
2020-11-08 15:07                 ` Eli Zaretskii
2020-11-06 14:38     ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2020-11-06  7:54 Boruch Baum
2020-11-06  8:05 ` Eli Zaretskii
2020-11-06 10:34   ` Boruch Baum
2020-11-06 12:06     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pn4q8zdz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=boruch_baum@gmx.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.