public function convert($string, $to_encoding, $from_encoding = null)
    {
        $from_encoding = (null !== $from_encoding) ? $from_encoding : static::getInternalEncoding();

        $result = iconv($from_encoding, $to_encoding, $string);

        if (false === $result) {
            throw EncodingConversionFailureException::forStringAndEncodings($string, $from_encoding, $to_encoding);
        }

        return $result;
    }
public function convert($string, $to_encoding, $from_encoding = null)
    {
        $from_encoding = (null !== $from_encoding) ? $from_encoding : static::getInternalEncoding();

        $result = iconv($from_encoding, $to_encoding, $string);

        if (false === $result) {
            throw EncodingConversionFailureException::forStringAndEncodings($string, $from_encoding, $to_encoding);
        }

        return $result;
    }
{@inheritDoc}