Using `#encode` sounds good, that way the test is not dependent on the file encoding marker.