Fix grepbar crash by guessing charset line by line