From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 9356B1F4B4 for ; Tue, 6 Apr 2021 14:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345094AbhDFOyW (ORCPT ); Tue, 6 Apr 2021 10:54:22 -0400 Received: from cloud.peff.net ([104.130.231.41]:42610 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239488AbhDFOyS (ORCPT ); Tue, 6 Apr 2021 10:54:18 -0400 Received: (qmail 7591 invoked by uid 109); 6 Apr 2021 14:54:09 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 06 Apr 2021 14:54:09 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 29250 invoked by uid 111); 6 Apr 2021 14:54:08 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 06 Apr 2021 10:54:08 -0400 Authentication-Results: peff.net; auth=none Date: Tue, 6 Apr 2021 10:54:08 -0400 From: Jeff King To: Andrey Bienkowski Cc: git@vger.kernel.org Subject: Re: Subject: Encoding of git diff --name-only stdout Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Apr 06, 2021 at 12:20:45PM +0000, Andrey Bienkowski wrote: > Hi. I want to parse the output of git diff --name-only and git diff > --name-status, but the documentation https://git-scm.com/docs/git-diff > does not say what encoding it is in. Is it always utf8 on all > platforms? If not is there a flag to make it so? Once I get an answer > to this question I'll submit a PR to add the missing documentation. There's some discussion in Documentation/i18n.txt, which is included in various manpages (e.g., https://git-scm.com/docs/git-log#_discussion) but it doesn't seem to be mentioned in git-diff. The short answer is: mostly utf8, but historically on platforms that don't care (like Linux) you could get away with other encodings. -Peff