diff --git a/roles/home-cli/files/gitwindows b/roles/home-cli/files/gitwindows index 47320ac..63e0631 100644 --- a/roles/home-cli/files/gitwindows +++ b/roles/home-cli/files/gitwindows @@ -9,3 +9,5 @@ helper = manager [credential "https://dev.azure.com"] useHttpPath = true +[diff "utf16diff"] + textconv = "C:/Users/anthony.perkins/data/workstation/roles/home-cli/files/utf16diff.cmd" diff --git a/roles/home-cli/files/utf16diff.cmd b/roles/home-cli/files/utf16diff.cmd new file mode 100644 index 0000000..a90dfa9 --- /dev/null +++ b/roles/home-cli/files/utf16diff.cmd @@ -0,0 +1,3 @@ +@ECHO OFF +REM Add "*.ps1 diff=utf16diff" to ~/.config/git/attributes to use this. +powershell.exe -Command "%~dp0\utf16diff.ps1" "%1" diff --git a/roles/home-cli/files/utf16diff.ps1 b/roles/home-cli/files/utf16diff.ps1 new file mode 100644 index 0000000..e56f0f6 --- /dev/null +++ b/roles/home-cli/files/utf16diff.ps1 @@ -0,0 +1,3 @@ +[string]$file = $args[0] +[string]$encoding = $(&"C:\Program Files\Git\usr\bin\file.exe" -b --mime-encoding $file) +&"C:\Program Files\Git\usr\bin\iconv.exe" -c -f $encoding -t UTF-8 $file