How does GitHub guess the encoding of a file?

Viewed 2604

How GitHub guesses encoding of a text file?

I have two text files in my repository: README.ru.koi8-r and mpman-ru.tex, both use encoding koi8-r. GitHub uses right encoding for the first one and uses wrong for the second one.

Maybe there is a trick to force right guess?

Postscript. I solved the problem by adding a long comment at the top of the file in koi8-r, but there should be a better way to do it.

2 Answers

You set the encoding for a repository with

git config gui.encoding koi8-r

Related