character encoding improvements