utf8_encode()WP 6.9.0

Deprecated. It is no longer supported and may be removed in future releases. See {@see \mb_convert_encoding()}.

Converts a string from ISO-8859-1 to UTF-8.

No Hooks.

Returns

String. Text converted into a UTF-8.

Usage

utf8_encode( $iso_8859_1_text ): string;
$iso_8859_1_text(string) (required)
Text treated as ISO-8859-1 (latin1) bytes.

Changelog

Since 6.9.0 Introduced.
Deprecated Use {@see \mb_convert_encoding()} instead.

utf8_encode() code WP 6.9.1

function utf8_encode( $iso_8859_1_text ): string {
	_deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' );

	return mb_convert_encoding( $iso_8859_1_text, 'UTF-8', 'ISO-8859-1' );
}

	else :
/**
 * @ignore
 * @private
 *
 * @since 6.9.0
 */
function utf8_encode( $iso_8859_1_text ): string {
	_deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' );

	return _wp_utf8_encode_fallback( $iso_8859_1_text );
}