Paul Eggert wrote:
Thanks for pointing out the problem. The bad behavior of gzip comes because
I thought programs in macOS etc. start off in the "C" locale, and that this
locale uses UTF-8. But I see now that the default locale is single-byte, and
that one must use setlocale with the "C.utf8" (or similarly-named) locale to
get a "C"-like locale with UTF-8 encoding.

I'd like to avoid the use of setlocale even in these environments, if
possible, as gzip is supposed to be small and "primitive". But I agree that
the behavior in current master is bad. I'll try to think of a better solution.

As it seems that the latest stable gzip is able to print correctly names like '/Users/haible/Téléchargements/Jörg.png' on all systems tested, what about escaping only the control characters common to ASCII and UTF-8?

Or even only the following control characters:
07(BEL) 08(BS) 09(HT) 0A(LF) 0B(VT) 0C(FF) 0D(CR) 1B(ESC) 7F(DEL)?

Best regards,
Antonio.




Reply via email to