add first_line replacement

fix test (encoding)