Encoding new returns Charset rather than the charset name->
Bug in test function