fix encoding comparison error