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

Failure on non-ascii chars in error messages #651

Merged
merged 1 commit into from
Sep 15, 2016

Conversation

mrh1997
Copy link
Contributor

@mrh1997 mrh1997 commented Sep 13, 2016

Libgit2 partially forwards OS error message texts.
I.e. the following error message (from C.giterr_last()) is generated on my german windows 10, when a fetch() is done but the remote repo is unavailable: failed to send request: Das Zeitlimit f\xc3\xbcr den Vorgang wurde erreicht.\r\n.

To avoid that a UnicodeDecodeError due to the contained 'ü' (encoded as '\xc3\xbc') is raised the error message must be interpreted as UTF-8.
The solution is not be necessary on linux/osx as they return always ascii (as far as I know).
Thus this solution will not change the behaviour on linux/osx but fix windows issues.

Libgit2 partially forwards OS error message texts.
On non-english Windows OSes these errors may contain non-ascii characters (i.e. umlauts).
To avoid that a UnicodeDecodeError is raised the error message is interpreted as UTF-8.
The solution should not be necessary on linux/osx as they return always ascii (as far as I know).
Thus this solution will not change the behaviour on linux/osx.
@jdavid jdavid merged commit 54e4da8 into libgit2:master Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants