UTF8 BOM (Byte order mark) should be supported

When a Gradle script (e.g. build.gradle, or init.gradle) begins with BOM (http://www.w3.org/International/questions/qa-byte-order-mark.en.php), it will not be correctly parsed by Gradle Engine. Although the presence of the BOM is irrelevant in the case of UTF8, the BOM may still occur in UTF-8 encoded text, therefore we should support it so as to make the program more robust.

For example, I have an init.gradle under my user home/.gradle, which is encoded in UTF-8 with BOM. Gradle will stop parsing it, and refuse all subsequent actions.

I assume this issue is reproducible on all versions, such as 2.4 2.3 etc. If you can’t reproduce it, feel free to let me know.