further fixes with guessing non-utf8 encoding, need more feedback, but probably got it right this time