Use NET::BufferedIO, handle encoding problems