WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

SimplePie_Misc::change_encoding() public WP 1.0

Change a string from one encoding to another

{} Это метод класса: SimplePie_Misc{}

Хуков нет.

Возвращает

Строку/true/false. False if we can't convert it

Использование

$result = SimplePie_Misc::change_encoding( $data, $input, $output );
$data(строка) (обязательный)
Raw data in $input encoding
$input(строка) (обязательный)
Encoding of $data
$output(строка) (обязательный)
Encoding you want

Код SimplePie_Misc::change_encoding() WP 5.5.3

<?php
public static function change_encoding($data, $input, $output)
{
	$input = SimplePie_Misc::encoding($input);
	$output = SimplePie_Misc::encoding($output);

	// We fail to fail on non US-ASCII bytes
	if ($input === 'US-ASCII')
	{
		static $non_ascii_octects = '';
		if (!$non_ascii_octects)
		{
			for ($i = 0x80; $i <= 0xFF; $i++)
			{
				$non_ascii_octects .= chr($i);
			}
		}
		$data = substr($data, 0, strcspn($data, $non_ascii_octects));
	}

	// This is first, as behaviour of this is completely predictable
	if ($input === 'windows-1252' && $output === 'UTF-8')
	{
		return SimplePie_Misc::windows_1252_to_utf8($data);
	}
	// This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported).
	elseif (function_exists('mb_convert_encoding') && ($return = SimplePie_Misc::change_encoding_mbstring($data, $input, $output)))
	{
		return $return;
 		}
	// This is third, as behaviour of this varies with OS userland and PHP version
	elseif (function_exists('iconv') && ($return = SimplePie_Misc::change_encoding_iconv($data, $input, $output)))
	{
		return $return;
	}
	// This is last, as behaviour of this varies with OS userland and PHP version
	elseif (class_exists('\UConverter') && ($return = SimplePie_Misc::change_encoding_uconverter($data, $input, $output)))
	{
		return $return;
	}

	// If we can't do anything, just fail
	return false;
}