Add PowerShell UTF-16 diff
This commit is contained in:
parent
2e164ec47e
commit
d9eed9f0a7
3 changed files with 8 additions and 0 deletions
|
@ -9,3 +9,5 @@
|
||||||
helper = manager
|
helper = manager
|
||||||
[credential "https://dev.azure.com"]
|
[credential "https://dev.azure.com"]
|
||||||
useHttpPath = true
|
useHttpPath = true
|
||||||
|
[diff "utf16diff"]
|
||||||
|
textconv = "C:/Users/anthony.perkins/data/workstation/roles/home-cli/files/utf16diff.cmd"
|
||||||
|
|
3
roles/home-cli/files/utf16diff.cmd
Normal file
3
roles/home-cli/files/utf16diff.cmd
Normal file
|
@ -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"
|
3
roles/home-cli/files/utf16diff.ps1
Normal file
3
roles/home-cli/files/utf16diff.ps1
Normal file
|
@ -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
|
Loading…
Reference in a new issue