Skip to content
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

Files.jsee are not seen as text by @github #2

Open
jesus2099 opened this issue Apr 6, 2020 · 8 comments
Open

Files.jsee are not seen as text by @github #2

jesus2099 opened this issue Apr 6, 2020 · 8 comments

Comments

@jesus2099
Copy link
Owner

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

@jesus2099
Copy link
Owner Author

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.

@jesus2099
Copy link
Owner Author

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

jesus2099 added a commit that referenced this issue Jul 8, 2020
@jesus2099
Copy link
Owner Author

It does not work:

Binary file not shown.

@jesus2099
Copy link
Owner Author

jesus2099 commented Aug 28, 2024

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

jesus2099 added a commit that referenced this issue Aug 28, 2024
EmEditor macro.jsee files are UTF-16LE with Signature*
But Git corrupts UTF-16 files (#2)

EmEditor seems to more or less accept that I force
this macro file to UTF-8 with Signature*

* Signature = byte order mark = BOM
  Without it, EmEditor corrupts the macro

BTW it's great because it will allow Git diff to work OK #2
@jesus2099
Copy link
Owner Author

jesus2099 commented Aug 28, 2024

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.

@mbs-c
Copy link

mbs-c commented Aug 28, 2024 via email

@jesus2099
Copy link
Owner Author

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!

@jesus2099
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants