-
Notifications
You must be signed in to change notification settings - Fork 2.7k
working-tree-encoding=UTF-16 checks out UTF-16BE #1995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is some recent (2 Nov 2018 ->) discussion on the main Git list regarding BOMs and the like. https://public-inbox.org/git/CADN+U_PUfnYWb-wW6drRANv-ZaYBEk3gWHc7oJtxohA5Vc3NEg@mail.gmail.com/ Have a look through the thread and see if it matches up with the problem as you are seeing it. |
Is this still an issue with the latest snapshot? |
To add a UTF-16LE with BOM encoded text file via Git for Windows:
If the file was committed prior to having the |
Setup
64 bit 2.19.1.windows.1
Windows 10.1803.17134 x64
defaults?
Default
to the issue you're seeing?
Don't think so.
Details
Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
The file should be written as UTF-16LE with BOM.
The file is written as UTF-16BE with BOM. This makes "working-tree-encoding" attribute pretty much useless, while it could potentially be very valuable to support UTF-16/UCS-2 files under Windows.
Not all tools under Windows understand UTF-16BE even with BOM. MSVC CRT doesn't. Visual Studio doesn't recognize those files as text (perhaps because it's using MSVC CRT to open them).
More information: The problem seems to be a general problem caused by libiconv devs decision to always produce UTF-16BE+BOM for UTF-16, without taking the BYTE_ORDER into account. iconv supplied with Git for Windows package exhibits same behavior. Existing precompild builds of ivonv/libiconv/libgettext for Windows (supplied by Michele Locati at https://mlocati.github.io/articles/gettext-iconv-windows.html) also exhibit same behavior.
BUT NEVERTHELESS, iconv installed with Centos 7.4 produces UTF-16LE+BOM, and Git 2.20 built at it from sources does that, as well. This means there may be a patch to force libiconv to the desired behavior of producing UTF-16LE on little-endian machines.
URL to that repository to help us with testing?
Not specific to a repository
The text was updated successfully, but these errors were encountered: