Subject: bug#29189: 25.3; Dired does not work with binary filenames

From: Eli Zaretskii <[email-masked]>
Date: Sat, 02 Dec 2017 11:01:01 +0200

> From: Allen Li <[email-masked]>
> Date: Fri, 1 Dec 2017 21:21:14 -0800
> Cc: Andreas Schwab <[email-masked]>, [email-masked], [email-masked]
> 
> I applied this patch to master (0b6f4f2c60) and it fixes the bug and
> doesn't crash Emacs immediately.  The code also looks right, but I am
> not familiar with Emacs's C code.  A few questions.
> 
> Why do we have to handle multibyte strings in this function
> decode_coding?  (I found the answer in the docs)

decode_coding needs to work when a series of raw bytes is inserted
into a multibyte buffer (which happens in the Dired case).

> Can you briefly explain how Emacs internally stores unibyte and
> multibyte strings?  (I found the answer in character.h)

Right, the details are in that header file.

> After doing the above research, I can more confidently say this is
> right, but having an expert opinion would be nice.

Thanks for proofreading the patch and testing it.  I'm waiting for
Handa-san to comment on it.