Instead of opening files as bytes and battling decoding to UTF-8 which can throw
exceptions, open directly as strings and replace invalid codepoints. This
handles licenses in encodings which are not UTF-8 but are based on ASCII much
better.
Also instead of extracting the license lines, writing them to a file, and then
hashing the file, hash the lines directly.
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>