Skip to content

Added support for encodings for Git.#24911

Merged
joaomoreno merged 1 commit intomicrosoft:masterfrom
igelbox:git-encoding
Apr 24, 2017
Merged

Added support for encodings for Git.#24911
joaomoreno merged 1 commit intomicrosoft:masterfrom
igelbox:git-encoding

Conversation

@igelbox
Copy link
Contributor

@igelbox igelbox commented Apr 17, 2017

Fixes #21146

Bug
Git always uses utf8 encoding for retrieving file contents.

Fix
Pass the 'files.encoding' configuration property to the git-extension and use this encoding to decode git output.

Fixes #21146

**Bug**
Git always uses utf8 encoding for retrieving file contents.

**Fix**
Pass the 'files.encoding' configuration property to the git-extension and use this encoding to decode git output.
@mention-bot
Copy link

@igelbox, thanks for your PR! By analyzing the history of the files in this pull request, we identified @joaomoreno and @dbaeumer to be potential reviewers.

@msftclas
Copy link

@igelbox,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla.microsoft.com.

It will cover your contributions to all Microsoft-managed open source projects.
Thanks,
Microsoft Pull Request Bot

@msftclas
Copy link

@igelbox, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.

Thanks, Microsoft Pull Request Bot

@joaomoreno joaomoreno added this to the April 2017 milestone Apr 18, 2017
@joaomoreno joaomoreno self-assigned this Apr 18, 2017
@joaomoreno joaomoreno self-requested a review April 18, 2017 07:07
@bizoo
Copy link

bizoo commented Apr 24, 2017

Git output must be decoded using the current view (file) encoding.
But FWIK, currently you cannot get/set the file encoding using API, so this PR is better than nothing, thanks igelbox to do it.

But it's NOT a complete solution.

@joaomoreno
Copy link
Member

Thanks! 🍻

Did a few changes:

  • Don't use the provided encoding for decoding stderr
  • Always look at the encoding value every time exec runs, don't store it
  • Simplify show by simply calling buffer (debt)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git doesn't consider actual encoding in diff view

5 participants