Force build.gradle to read file using UTF-8.

Also, don't lose trailing newline, if any. Adds one if missing.