jesus2099/settei

Files.jsee are not seen as text by @github

Opened this issue · 8 comments

Example 807bc1f where it says Binary file not shown. instead of showing text diff (files.jsee are JavaScript text files).

I made a post in github.community about it in 2017: https://github.community/t5/How-to-use-Git-and-GitHub/files-jsee-JavaScript-but-Binary-file-not-shown/m-p/608

I noticed someone else with same question in 2019: https://github.community/t5/GitHub-Pages/Source-files-shown-as-binary-files/m-p/35456

The answer says Try creating a .gitattributes file with *.jsee text But I'm not sure if it will force github to not see files.jsee as being binaries and showing diff for them. I thought .gitattributes was more related to git command new line management.

Same for .esy configuration files in plain text: b0c4692 .

It does not work:

Binary file not shown.

😱 Wow it's even worse! Git corrupts UTF-16 files, completely!

WOW! Here is maybe why my UTF-16 LE files were corrupted by Git (I've been using both Windows and Linux on my repo):

https://github.com/git/git/pull/1294/commits
git/git@4d00437

@mbs-c:

Perforce silently replaces LF with CR LF for "utf16" files if the client is a native Windows client. Since git's autocrlf logic does not undo this transformation for UTF-16 encoded files, git-p4 replaces CR LF with LF during the sync if the file type "utf16" is detected and the Perforce client platform indicates that this conversion is performed.

Windows only runs on little-endian architectures, therefore the encoding of the byte stream received from the Perforce client is UTF-16-LE and the relevant byte sequence is 0D 00 0A 00.

(I don't know what is Perforce, though)

But I have of course deactivated autocrlf in all my repos, since the the beginnings, so I'm not sure I understand.

Yes I was reading that git-p4.py file and began to understand it had nothing to do with my use. 😉

Thanks for taking the time, letting me know, too!

I have to find my pre-corrupt files... before checking them out with git...
I have a 2018 zip file of the repo, when it was still called settings.

Oh great! I can actually just see files correctly in GitHub and copy code, then paste in the jsee file that I resave as UTF-8 with BOM.