objective-git icon indicating copy to clipboard operation
objective-git copied to clipboard

Diffs do not support non-UTF8 content

Open jspahrsummers opened this issue 11 years ago • 3 comments

For example, fetching the diff for graphics.ai in mhettler/accuratelockandhardware.com@4e77bd2ff0775d592175afe73586d0751891be00 will result in many nil hunk headers and lines.

libgit2 is giving us valid C strings — at least in the sense that they represent the file's content, but may be in an unknown encoding. We should use Cocoa's text encoding functions or implement some fallbacks to handle more possible cases.

jspahrsummers avatar Jun 30 '13 06:06 jspahrsummers

Those are Adobe illustrator files, so they really should be treated as binary.

alanjrogers avatar Jun 30 '13 08:06 alanjrogers

@alanjrogers Core git doesn't treat them that way either, for whatever reason, though that doesn't mean we can't.

jspahrsummers avatar Jun 30 '13 08:06 jspahrsummers

Core git has a --binary flag that you can pass to diff to get binary diffs instead of line-oriented text diffs. I'm not actually sure what it does differently in that case - let me check it out.

arrbee avatar Jul 01 '13 19:07 arrbee