Use Encoding object instead of encoding name