Handling text files encoded in little-endian UTF-16 with BOM

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

 



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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux