Skip to content

Commit 3a29c2e

Browse files
jcmcmb69
jcm
authored andcommitted
Add test for iconv_mime_encode() for input-charset and output-charset
Closes GH-8766.
1 parent 03e72e7 commit 3a29c2e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
iconv_mime_encode(): Encoding parameter exceeds the maximum allowed for preference "input-charset" and "output-charset"
3+
--EXTENSIONS--
4+
iconv
5+
--INI--
6+
iconv.internal_charset=iso-8859-1
7+
--FILE--
8+
<?php
9+
$extra = str_repeat("x", 256);
10+
11+
$preferences = [
12+
"input-charset" => "ISO-8859-1".$extra,
13+
"output-charset" => "UTF-8",
14+
"line-length" => 76,
15+
"line-break-chars" => "\n",
16+
"scheme" => "B"
17+
];
18+
19+
$result = iconv_mime_encode("Subject", "Prüfung", $preferences);
20+
var_dump($result);
21+
22+
$preferences["input-charset"] = "ISO-8859-1";
23+
$preferences["output-charset"] = "UTF-8".$extra;
24+
25+
$result = iconv_mime_encode("Subject", "Prüfung", $preferences);
26+
var_dump($result);
27+
?>
28+
--EXPECTF--
29+
Warning: iconv_mime_encode(): Encoding parameter exceeds the maximum allowed length of %d characters in %s on line %d
30+
bool(false)
31+
32+
Warning: iconv_mime_encode(): Encoding parameter exceeds the maximum allowed length of %d characters in %s on line %d
33+
bool(false)

0 commit comments

Comments
 (0)