On Tue, Sep 27, 2011 at 11:43 AM, Rhett Sutphin <[email protected]>wrote:
> > I'll fix this in Buildr so the next release doesn't apply filter mappings > > willy-nelly on binary files. (BTW, do you have any suggestion on good > > binary content detection?) > > I looked into this when I was working on jartools[1]. I don't know how good > it is, but I ended up using the technique that diff uses[2] -- if there are > any null bytes, it's binary; otherwise text. > > Rhett > > [1]: https://github.com/NUBIC/jartools > [2]: http://www.gnu.org/s/hello/manual/diff/Binary.html I like the simplicity of it; my main concern was returning a false-positive on UTF8/UTF16 files but based on all the samples I could find on my machine, it doesn't look like these use \000 so I think I'll use that. alex
