Diff UTF-16 encoded text and binary plist files

suggest change

You can diff UTF-16 files (iOS and macOS .strings files are examples) by telling Git how to convert them to text.

Add the following to your ~/.gitconfig file.

[diff "utf16"]
textconv = "iconv -f utf-16 -t utf-8"

iconv is a program to convert different encodings.

Then edit or create a .gitattributes file in the root of the repository. Git does not read ~/.gitattributes unless core.attributesFile points at it.

*.strings diff=utf16

This will convert all files ending in .strings before git diffs.

You can do similar things for other files, that can be converted to text.

For binary plist files you edit .gitconfig

[diff "plist"]
textconv = plutil -convert xml1 -o -

and .gitattributes

*.plist diff=plist

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents