git_futils_find_global_file fails for users with non-ASCII characters in their username #724

aroben opened this Issue May 23, 2012 · 4 comments


None yet
2 participants

aroben commented May 23, 2012

git_futils_find_global_file contains two calls to getenv, which will return strings encoded via the current code page. But we assume that these strings are UTF-8, which then causes other file-related APIs to fail.

I think we need to call either _wgetenv or GetEnvironmentVariableW, both of which return a UTF-16 string, and then convert it to UTF-8. I believe this matches how we deal with similar issues elsewhere.

/cc @arrbee

arrbee was assigned May 23, 2012


arrbee commented May 23, 2012

Fix in progress


arrbee commented May 23, 2012

Fixing this was pretty easy. Writing the tests - not so much.


arrbee commented May 24, 2012

Perhaps spoke too soon. I'm still having some issues.


arrbee commented May 29, 2012

I believe this issue is now solved. We could probably go even further (there are suggestions about using SHGetFolderPath instead of examining environment variables as we do today), but I think the immediate problem has been taken care of.

arrbee closed this May 29, 2012

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