2
Test iconv_set_encoding() function : basic functionality
5
extension_loaded('iconv') or die('skip');
6
function_exists('iconv_set_encoding') or die("skip iconv_set_encoding() is not available in this build");
10
/* Prototype : bool iconv_set_encoding(string type, string charset)
11
* Description: Sets internal encoding and output encoding for ob_iconv_handler()
12
* Source code: ext/iconv/iconv.c
16
* Test Error functionality of iconv_get_encoding
19
echo "*** Testing iconv_set_encoding() : error functionality ***\n";
21
//get an unset variable
28
public function __toString() {
38
// get a resource variable
39
$fp = fopen(__FILE__, "r");
41
// unexpected values to be passed to $encoding argument
71
// invalid string data
80
/*22*/ @$undefined_var,
89
// loop through each element of $inputs to check the behavior of mb_regex_encoding()
91
foreach($inputs as $input) {
92
echo "\n-- Iteration $iterator --\n";
93
var_dump( iconv_set_encoding($input, "UTF-8") );
102
*** Testing iconv_set_encoding() : error functionality ***
175
Warning: iconv_set_encoding() expects parameter 1 to be string, resource given in %s on line %d
b'\\ No newline at end of file'