Skip to content

Commit 9e3f352

Browse files
committed
Throw warning for invalid iconv charset
1 parent 0a573f9 commit 9e3f352

5 files changed

+6
-6
lines changed

ext/iconv/iconv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,11 +1777,11 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
17771777
break;
17781778

17791779
case PHP_ICONV_ERR_CONVERTER:
1780-
php_error_docref(NULL, E_NOTICE, "Cannot open converter");
1780+
php_error_docref(NULL, E_WARNING, "Cannot open converter");
17811781
break;
17821782

17831783
case PHP_ICONV_ERR_WRONG_CHARSET:
1784-
php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
1784+
php_error_docref(NULL, E_WARNING, "Wrong charset, conversion from \"%s\" to \"%s\" is not allowed",
17851785
in_charset, out_charset);
17861786
break;
17871787

ext/iconv/tests/iconv_strlen_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ var_dump(iconv_strlen($string, $encoding));
2323
--EXPECTF--
2424
*** Testing iconv_strlen() : error ***
2525

26-
Notice: iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
26+
Warning: iconv_strlen(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
2727
bool(false)

ext/iconv/tests/iconv_strpos_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ echo "Done";
2424
--EXPECTF--
2525
*** Testing iconv_strpos() : error conditions ***
2626

27-
Notice: iconv_strpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
27+
Warning: iconv_strpos(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
2828
bool(false)
2929
Done

ext/iconv/tests/iconv_strrpos_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ echo "Done";
2525
--EXPECTF--
2626
*** Testing iconv_strrpos() : error conditions ***
2727

28-
Notice: iconv_strrpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
28+
Warning: iconv_strrpos(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
2929
bool(false)
3030
Done

ext/iconv/tests/iconv_substr_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ echo "Done";
2525
--EXPECTF--
2626
*** Testing iconv_substr() : error conditions ***
2727

28-
Notice: iconv_substr(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
28+
Warning: iconv_substr(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
2929
bool(false)
3030
Done

0 commit comments

Comments
 (0)