gh150: fix detection of file encoding