felipec/git-related

UTF-8 issues with invalid byte sequences.

Closed this issue · 4 comments

Some authors with umlaut letters in their names can get author details in git blame containing invalid UTF-8, specifically if they're on strange systems like windows.
By doing line.encode! :invalid=>:replace before trying to match strings in get_blame, I've personally managed to get around that issue, but that might not be a useful fix for everyone. Anyhow, just a heads up. :)

It works fine on my Linux system. Have you tried to set LC_ALL in Windows?

Right, I was probably being a little unclear. I'm running this under bash on a Mac, but other authors use windows machines where I cannot control the written encoding. This makes your script not crash. :)

I see the issue now. By default Git uses UTF-8. Fixed in 62cb4df.

Thanks @felipec !