Subject: Re: bug#58281: 27.1; windows mangles encoding on command line

From: Daniel Bastos <[email-masked]>
Date: Thu, 6 Oct 2022 09:03:50 -0300

On Tue, Oct 4, 2022 at 7:02 AM Eli Zaretskii <[email-masked]> wrote:
> > From: Wayne Harris <[email-masked]>
> > Date: Mon, 03 Oct 2022 22:18:35 -0300
> >
> > I run emacs -Q.  I open eshell.  Then I try to use fossil (which is a
> > version control system like git) and try to put accented letters on the
> > commit message.  No choice of encoding seems to avoid the mangling.
> >
> > c:/my/path $ alias fs 'fossil $*'
> > c:/my/path $ echo kkk >> encoding.txt
> > c:/my/path $ fs changes
> > EDITED     encoding.txt
> >
> > c:/my/path $ (print default-process-coding-system)
> > (undecided-dos . undecided-unix)
> >
> > c:/my/path $ (or buffer-file-coding-system "it is nil")
> > it is nil
> >
> > c:/my/path $ fs commit -m 'Naiveté'
> > [...]
> > Sync done, wire bytes sent: 3234  received: 309  ip: 5.161.138.46
> >
> > c:/my/path $ fs timeline -n 1
> > === 2022-10-02 ===
> > 13:11:20 [febbbf0441] *CURRENT* NaivetÃ© (user: mer tags: trunk)
> > --- entry limit (1) reached ---
> > c:/my/path $
>
> Where did you download Fossil for MS-Windows?  Is it a native Windows
> program, or a Cygwin program?  Is 'fs' a program (i.e. fs.exe) or some
> kind of shell script, and if the latter, can you post the script?

I went to

  https://fossil-scm.org/home/uv/download.html

and chose the last one --- Windows64 ---, which is the ZIP at

  https://fossil-scm.org/home/uv/fossil-w64-2.19.zip

Inside this ZIP, there's a fossil.exe binary.  All evidence points to
a native Windows program, not a Cygwin program.

%file c:/my/path/fossil.exe
c:/my/path/fossil.exe: PE32+ executable (console) x86-64, for MS Windows
%

There's no fs.exe and no script fs.  (Sorry about that.)  That's just
my alias in ESHELL.  You can safely assume that /fs/ just means
/fossil/.  (I shouldn't have used the alias in this bug report.
Sorry.)

> Also, do you know whether Fossil expects the message text in some
> particular encoding?

That I don't know.  I've looked into the documentation, but I did not
find anything that looked relevant.  I did find old commit messages in
the repository of fossil itself that little by little the developers
have been adding UTF-8 support to it.  But I can't say it expects any
particular encoding.

Thank you for looking into this issue.