git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Mateusz Loskot <mateusz@loskot.net>
To: git@vger.kernel.org
Subject: Handling text files encoded in little-endian UTF-16 with BOM
Date: Fri, 5 Jul 2019 13:35:13 +0200	[thread overview]
Message-ID: <CABUeae_90xG7avh1yt2_X78pmpYUvLtXAZ2Kd9A=FpcEayvi-Q@mail.gmail.com> (raw)

Hi,

Using git version 2.22.0.windows.1

I have a repository with number of .txt files encoded in
little-endian UTF-16 with BOM.

What are the best practice and recommended configuration to
manage such files with Git to avoid unexpected re-encoding to
UTF-8 or others?

Currently, there is .gitattriuts with entries like

   resource/*.txt   working-tree-encoding=UTF-16LE-BOM -text

Despite that some of team members have noticed that the files
occacionally get re-encoded to UTF-8. It is unknow what are
actual steps leading to that. BTW, there a few Git clients
in use: git in Git Bash, VSCode, Fork.

What bothers me in the .gitattributes is this `-text` attribute.

Is the use of `working-tree-encoding` and `-text` together a
valid combination at all?

The documentation at https://git-scm.com/docs/gitattributes
does not seem to touch on that.

I'll appreciate any suggestions on those UTF-16LE-BOM files.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

             reply	other threads:[~2019-07-05 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 11:35 Mateusz Loskot [this message]
2019-07-05 16:25 ` Handling text files encoded in little-endian UTF-16 with BOM Torsten Bögershausen
2019-07-05 18:52   ` Mateusz Loskot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABUeae_90xG7avh1yt2_X78pmpYUvLtXAZ2Kd9A=FpcEayvi-Q@mail.gmail.com' \
    --to=mateusz@loskot.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).