Patch Set 2: I would prefer that you didn't submit this

(3 inline comments)

C Git permits the user to set any string they want into the i18n.commitencoding variable in the config file. If this isn't UTF-8 or utf-8, then the string is stored as-is into the "encoding" header of a commit object.

I suspect the bug reporter had some user enter "latin-1" into this variable and create a ton of commits with it. C Git when reading commits tries to honor the encoding header, and then falls back when it doesn't understand it. That fallback is probably working here to allow the latin-1 encoding header.

IMHO, JGit will need to support this header, just like we need to support that damn leading '0' in the mode field of tree objects, thanks to GitHub's online web editor.

Of course, according to http://www.iana.org/assignments/character-sets the correct alias is 'latin1', not 'latin-1'. *sigh*