Check if a file ends with a given utf-8 string.