-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Git doesn't consider actual encoding in diff view #21146
Comments
Note that this issue is not related to SCM Preview, I've the same behavior in 1.10.2 without it enabled. |
@joaomoreno I have an open request to bring this same functionality to GitLens -- so it would be wonderful if what is done here would be accessible to extensions. |
For now, I have to go back to the previous version with the command "Disable Preview SCM". |
I was hoping the new auto-detect of file encoding would help here, but it looks like that feature only works for actual files on disk and not via content providers. :( |
I am working on a patch series for core Git to help Git understand different encodings. If this sounds interesting to you, then I would love to hear your feedback on my proposal: https://github.com/git/git/pull/440/files#diff-6fb066a3d66afe00c0995f97f5c680fd The current mailing list discussion is here if you want to chime in: |
I have the same issue with the Mercurial plugin (https://marketplace.visualstudio.com/items?itemName=mrcrowl.hg). Problem is the same on both views. Diff view. Whole document marked as changed, but 2 lines deleted only: Preferenced file encoding is set to "files.encoding": "windows-1251". VSCode version: |
Fixed by having git attempt to detect encoding when Some encodings are still improperly detected: https://github.com/Microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Afile-encoding+label%3Aupstream |
IMHO, the only good way to solve this issue is to use the encoding of the view, so to first resolve #824. Why having a proper API to set/get encoding is so long to be done ? Seriously, it's not a rhetorical question: Is it because it's difficult or because it's a very low priority thing ? Or something else ? |
Steps to Reproduce:
In the example above, I just added a blank line in a Windows 1252 file.
The text was updated successfully, but these errors were encountered: