Subject: bug#49808: 27.1; ediff assumes user's language is English

From: Matthieu Dubuget <[email-masked]>
Date: Mon, 22 Aug 2022 14:49:28 +0200

I managed to reproduce the problem on a linux virtual machine ran from 
my new work machine.

First, some context (note that "tutu" one-line file does not have a 
carriage return):

```bash
madu@alienmadu:~$ cat /etc/issue
Debian GNU/Linux 11 \n \l

madu@alienmadu:~$ uname -a
Linux alienmadu 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 
22:23:49 UTC 2021 x86_64 GNU/Linux
madu@alienmadu:~$ emacs --version
GNU Emacs 27.1
Copyright (C) 2020 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
madu@alienmadu:~$ cat toto
auiea
madu@alienmadu:~$ cat tutu
eaiamadu@alienmadu:~$ locale
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
madu@alienmadu:~$ diff toto tutu
1c1
< auiea
---
 > eaia
\ Pas de fin de ligne à la fin du fichier
madu@alienmadu:~$
```

Then:
- emacs -Q
- M-x ediff-files

Just to be sure, I did `dpkg-reconfigure locales` and:

```bash
madu@alienmadu:~$ sudo dpkg-reconfigure locales
[sudo] Mot de passe de madu :
Generating locales (this might take a while)...
   en_US.UTF-8... done
Generation complete.
madu@alienmadu:~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
madu@alienmadu:~$ diff toto tutu
1c1
< auiea
---
 > eaia
\ No newline at end of file
madu@alienmadu:~$
```

And this time, I could ediff my two files from emacs.

Best regards

Le 22/08/2022 à 12:58, Lars Ingebrigtsen a écrit :
> Matthieu Dubuget <[email-masked]> writes:
>
>> When using Ediff with a non-English locale, errors returned by diff are
>> not recognized by Ediff.
>>
>> When diff outputs a localized version of "\ No newline at end of file",
>> ediff do not recognize it and fails to display the differences.
>>
>> See https://stackoverflow.com/q/9242651/3407924
>> and this post for a clear explanation of the problem:
>> https://stackoverflow.com/a/9244759/3407924
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> Do you have a recipe to reproduce this problem, starting from "emacs
> -Q"?
>
> I tried starting Emacs with
>
> LANG=de_DE.UTF-8 emacs -Q
>
> and then using ediff, but I was unable to reproduce the problem