Fixed bug that occured when a file was not UTF-8 encoded