Expand description
change encodings based on the working-tree-encoding
attribute.
Worktree encodings are powered by the encoding_rs
crate, which has a narrower focus than the iconv
library. Thus this implementation
is inherently more limited but will handle the common cases.
Note that for encoding to legacy formats, additional normalization steps can be taken, which we do not yet take unless there is specific examples or problems to solve.
Modules§
Functions§
- Decode
src
according tosrc_encoding
toUTF-8
for storage in git and place it inbuf
. Note that the encoding is always applied, there is no conditional even ifsrc_encoding
already isUTF-8
. - Encode
src_utf8
, which is assumed to be UTF-8 encoded, according toworktree_encoding
for placement in the working directory, and write it tobuf
, possibly resizing it. Note that the encoding is always applied, there is no conditional even ifworktree_encoding
and thesrc
encoding are the same.