GNU bug report logs - #36085
find-dired could handle/avoid octal escapes printed by GNU find -ls for non-ASCII filenames

Previous Next

Package: emacs;

Reported by: Nikita <grindeg <at> yandex.ru>

Date: Tue, 4 Jun 2019 04:12:02 UTC

Severity: wishlist

Merged with 41488

Found in versions 26.2, 26.3

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nikita <grindeg <at> yandex.ru>
Cc: 36085 <at> debbugs.gnu.org
Subject: bug#36085: 26.2; find-dired octal escapes instead of Cyrillic text
Date: Sat, 08 Jun 2019 15:20:18 +0300
> From: Nikita <grindeg <at> yandex.ru>
> Date: Tue, 4 Jun 2019 08:43:06 +0500
> 
> When i open dired, go to the needed directory, run "M-x dired-find"
> "-name "*Портрет*" (or anything at all that will give some results)
> results come back with octal escapes instead of Cyrillic letters.
> I cannot open pictures that it finds for example.

Turns out the octal escapes are produced by 'find' itself in this
case.  Try the following command in that directory from the shell
prompt:

   find . \( -iname "*Портрет*" \) -ls

and you will see the same octal escape instead of the Cyrillic
characters.  The man page for 'find' clearly documents this, under
"Unusual Filenames":

 Unusual characters are handled differently by various actions, as
 described below.
 [...]

   -ls, -fls
	 Unusual characters are always escaped.  White space,  backslash,
	 and  double  quote characters are printed using C-style escaping
	 (for example `\f', `\"').  Other unusual characters are  printed
	 using  an octal escape.  Other printable characters (for -ls and
	 -fls these are the characters between octal 041  and  0176)  are
	 printed as-is.

What this means is that any non-ASCII character will be converted to a
series of octal escapes.  IMO, this is a terrible misfeature in GNU
Findutils, as such "handling" of non-ASCII characters has no place in
today's global environment.

I suggest to report this bug to the GNU Findutils developers.

Thanks.

P.S. Emacs could perhaps go above and beyond the call of duty, and
attempt to convert the octal escapes back to readable text.  But I
don't think we should do it, as it's a clear bug in 'find'.
Nonetheless, if someone wants to submit patches to do such a
conversion, I won't block them.




This bug report was last modified 3 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.