[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: encoding problem with ezwinports make but not msys make

From: Eli Zaretskii
Subject: Re: encoding problem with ezwinports make but not msys make
Date: Fri, 10 Mar 2017 09:06:24 +0200

> From: Tomas Nordin <address@hidden>
> Date: Thu, 09 Mar 2017 21:33:58 +0100
> At work on a windows machine I have two versions of make. One from the
> ezwinports and one installed via the msys2 pacman package manager. Using
> text including non-ascii works fine with the latter but not the former.
> Below an attempt to describe what happens:
> --------8<--------
> <user>@<node> MSYS ~/slask
> $ make --version
> GNU Make 4.2.1
> Built for x86_64-pc-msys

This is an MSYS2 build of Make.  The resulting binary is not a native
Windows application, it needs the MSYS2 DLL to run.  MSYS2 is a fork
of Cygwin, which uses UTF-8 codeset as its native encoding.

> <user>@<NODE> MSYS ~/slask
> $ /c/usr/bin/make.exe --version
> GNU Make 4.2.1
> Built for Windows32

This is a native Windows build of Make.  It supports only the encoding
of the current system codepage, and that encoding can never be UTF-8,
because Windows doesn't allow UTF-8 to be the codeset of a locale.

> $ cat Makefile
> .PHONY: fiske
> fiske:
>         echo "Jag går och fiskar även på denna ö"
> $ make fiske
> echo "Jag går och fiskar även på denna ö"
> Jag går och fiskar även på denna ö
> <user>@<NODE> MSYS ~/slask
> $ /c/usr/bin/make.exe fiske
> echo "Jag g Ñr och fiskar  ñven p Ñ denna  Â"
> Jag går och fiskar även på denna ö
> $ file Makefile
> Makefile: UTF-8 Unicode text, with CRLF line terminators

That's expected: UTF-8 text is not really supported.

> I wonder if someone on this list know how to get the ezwinports make to
> interpret the Makefile text as utf-8. If that is the problem, else
> otherwise guide me how to get it to work with that port.

Does the above problem happen if you invoke Make from the Windows cmd
prompt, not from MSYS2 Bash, and make sure sh.exe is not on your Path,
or add "SHELL = cmd.exe" to the Makefile?  When I do that, I get the
UTF-8 text unscathed.  I think what happens in your case is that Make
invokes Bash, which then uses its builtin 'echo' to show the text, and
that doesn't really work due to the above-mentioned issue with UTF-8.

If that doesn't help, then you can't have what you want with the
native Windows port of Make, sorry.  The only way is to recode the
Makefile so that it is encoded in the current system codepage.

Alternatively, you can continue using the MSYS2 Make, if UTF-8 text in
Makefiles is something that you must have.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]