Better handling of mixed latin-1 and utf-8 input. Still no binary support (jpeg, x509, etc.)