Encode before comapring

With certain non-English languages, characters within the string that
is being used for comparison could be HTML encoded (see
WP_Scripts::localize() in wp-includes/class.wp-scripts.php). This
change ensures that we're checking the encoded string, which prevents
false negatives.