unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: boruch_baum@gmx.com, emacs-devel@gnu.org
Subject: Re: fixing url-unhex-string for unicode/multi-byte charsets
Date: Fri, 06 Nov 2020 17:04:05 +0200	[thread overview]
Message-ID: <83eel68r2y.fsf@gnu.org> (raw)
In-Reply-To: <jwvzh3uedpt.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Fri, 06 Nov 2020 09:59:02 -0500)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Boruch Baum <boruch_baum@gmx.com>,  emacs-devel@gnu.org
> Date: Fri, 06 Nov 2020 09:59:02 -0500
> 
> >  (dolist (str '("hello%20world"
> >                 "%d7%a9%d7%9c%d7%95%d7%9d%20%d7%a2%d7%95%d7%9c%d7%9d"))
> >    (insert (decode-coding-string (url-unhex-string str)
> >                                  (or file-name-coding-system
> >                                      default-file-name-coding-system))
> >            "\n"))
> >
> > The result of evaluating this is two lines inserted into the current
> > buffer:
> >
> >   hello world
> >   שלום עולם
> >
> > If this doesn't work for you, or if you tried something slightly
> > different, I'd like to hear the details, perhaps there's some
> > subtlety I'm missing.
> 
> My guess is that his `file-name-coding-system` is set to something
> different from utf-8.
> [ BTW, I wouldn't be surprised to hear that the Freedesktop spec
>   documents that the file names in the Trash should use utf-8, in which
>   case the code should hard-code utf-8 rather than use
>   `file-name-coding-system` ;-)  ]

If the trash spec says it must be UTF-8, then yes, TRT is to use that
unconditionally.  But if the spec says nothing, I'd expect the file
names to be in whatever encoding they were on disk, which usually
should coincide with file-name-coding-system.



  reply	other threads:[~2020-11-06 15: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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83eel68r2y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=boruch_baum@gmx.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 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).