Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-encoding.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / lib-encoding.sh` 25 lines ยท 438 bytes Raw Blame History 1 # Encoding helpers 2 3 test_lazy_prereq NO_UTF16_BOM ' 4 test $(printf abc | iconv -f UTF-8 -t UTF-16 | wc -c) = 6 5 ' 6 7 test_lazy_prereq NO_UTF32_BOM ' 8 test $(printf abc | iconv -f UTF-8 -t UTF-32 | wc -c) = 12 9 ' 10 11 write_utf16 () { 12 if test_have_prereq NO_UTF16_BOM 13 then 14 printf '\376\377' 15 fi && 16 iconv -f UTF-8 -t UTF-16 17 } 18 19 write_utf32 () { 20 if test_have_prereq NO_UTF32_BOM 21 then 22 printf '\0\0\376\377' 23 fi && 24 iconv -f UTF-8 -t UTF-32 25 }