SimplePie 1.3.1 is now available. Upgrade now!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie » set_input_encoding()

set_input_encoding()

Description

class SimplePie {
	set_input_encoding ( [string $encoding = false] )
}

Allows you to override the character encoding of the feed. This is only useful for times when the feed is reporting an incorrect character encoding (as per RFC 3023 and Determining the character encoding of a feed). This setting is similar to set_output_encoding().

The number of supported character encodings depends on whether your web host supports mbstring, iconv, or both. See Supported Character Encodings for more information.

Availability

  • Available since SimplePie 1.0.
  • Previously existed as input_encoding() since Beta 3.

Parameters

encoding

The character encoding to use instead of allowing SimplePie to auto-detect it.

Examples

Override a feed's input

$feed = new SimplePie();
$feed->set_feed_url('http://nurapt.kaist.ac.kr/~jamaica/htmls/blog/rss.php');
$feed->set_input_encoding('EUC-KR');
$feed->init();
$feed->handle_content_type();
echo $feed->get_title();

See Also


reference/simplepie/set_input_encoding.txt · Last modified: 2011/03/05 19:56 (external edit)