fixes some issues with charsets