Module gix_filter::worktree

source ·
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 to src_encoding to UTF-8 for storage in git and place it in buf. Note that the encoding is always applied, there is no conditional even if src_encoding already is UTF-8.
  • Encode src_utf8, which is assumed to be UTF-8 encoded, according to worktree_encoding for placement in the working directory, and write it to buf, possibly resizing it. Note that the encoding is always applied, there is no conditional even if worktree_encoding and the src encoding are the same.