Fix quality flaws: should not depend on default encoding