Correctly ignore parent directories when requested

Also does a ninja fix for undetectable decoding (by
assuming those files are utf-8 as a fallback, which
seems reasonable to do when chardet is unable to
figure out the encoding).

Fixes bug 1363191

Change-Id: I15c172f511a939b21c37f772eb17f78105acf648
Merge "Correctly ignore parent directories when requested"