$encoded = encode_entities($input, "^\x20-\x7E"); # do not encode printable ASCII chars