Update usage of iconv_get_encoding so that it is only used for PHP < 5.6

Based on the change made here:  https://github.com/zendframework/zf2/blob/master/tests/ZendTest/Validator/HostnameTest.php#L33