# Subject: Encoding of git diff --name-only stdout

2 messages from 2021-04-06 to 2021-04-06. Participants: Andrey Bienkowski, Jeff King.
Thread: https://gitlist.dev/t/55441

## Andrey Bienkowski, 2021-04-06 12:20

Subject: Subject: Encoding of git diff --name-only stdout
Message-ID: <CAAunPhfjUSO0Po4sO7Hwxjq7_p0ke7VOD=XRizG1Fqkzymcgmg@mail.gmail.com>
URL: https://gitlist.dev/e/CAAunPhfjUSO0Po4sO7Hwxjq7_p0ke7VOD%3DXRizG1Fqkzymcgmg%40mail.gmail.com

```
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.
-- Andrey Bienkowski

```

## Jeff King, 2021-04-06 14:54

Subject: Re: Subject: Encoding of git diff --name-only stdout
Message-ID: <YGx2EMHnwXWbp4ET@coredump.intra.peff.net>
URL: https://gitlist.dev/e/YGx2EMHnwXWbp4ET%40coredump.intra.peff.net
In-Reply-To: <CAAunPhfjUSO0Po4sO7Hwxjq7_p0ke7VOD=XRizG1Fqkzymcgmg@mail.gmail.com>

```
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

```
