Correct encoding check, fixes warning

Warning was:  
warning: Ignoring internal encoding UTF-8: it is identical to external encoding UTF-8