Expand description
Git commit encoding labels (encoding header, i18n.commitEncoding) mapped to codecs.
Git’s ISO-8859-1 is strict Latin-1; encoding_rs maps that label to Windows-1252, so we
handle Latin-1 separately.
Functions§
- decode_
bytes - Decode
bytesusing Git’s encoding name, or lossy UTF-8 if unknown. - encode_
header_ text - Encode a single header field (author/committer line) without adding a trailing newline.
- encode_
unicode - Encode
unicodefor storage in a commit message body using Git’s encoding name. - ensure_
body_ trailing_ newline - Git stores the commit message body with a trailing newline when non-empty.
- reencode_
utf8_ to_ label - Re-encode
unicodefrom UTF-8 intooutput_label, orNoneif unsupported. - resolve
- Resolve an encoding label the way Git uses it in config and commit objects.