Don't set innerHTML to false

Mistakenly setting the innerHTML to false, so went back to classic
if/else if statements to only set on these 2 cases
Detect encoding and use that in if statement

Try to detect encoding type and check on it not being ASCII in if
statement too