Fixed encoding bug -> HTML issue. Added encoding detection nevertheless