Annotation of embedaddon/php/ext/iconv/tests/iconv_mime_encode.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: iconv_mime_encode()
3: --SKIPIF--
4: <?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
5: --INI--
6: iconv.internal_charset=iso-8859-1
7: --FILE--
8: <?php
9: function my_error_handler($errno, $errmsg, $filename, $linenum, $vars)
10: {
11: echo "$errno: $errmsg\n";
12: }
13: set_error_handler('my_error_handler');
14: $preference = array(
15: "scheme" => "B",
16: "output-charset" => "ISO-2022-JP",
17: "input-charset" => "EUC-JP",
18: "line-break-chars" => "\n"
19: );
20: for ($line_len= 0; $line_len < 80; ++$line_len) {
21: print "-------- line length=$line_len\n";
22: $preference["line-length"] = $line_len;
23: $result = iconv_mime_encode("From", "サンプル文字列サンプル文字列日本語テキスト", $preference);
24: var_dump($result);
25: if ($result !== false) {
26: $max = max(array_map("strlen", explode("\n", $result)));
27: print "-------- ";
28: var_dump(($max <= $line_len));
29: } else {
30: print "-------- \n";
31: }
32: }
33: ?>
34: --EXPECTF--
35: -------- line length=0
36: 2: %s
37: bool(false)
38: --------
39: -------- line length=1
40: 2: %s
41: bool(false)
42: --------
43: -------- line length=2
44: 2: %s
45: bool(false)
46: --------
47: -------- line length=3
48: 2: %s
49: bool(false)
50: --------
51: -------- line length=4
52: 2: %s
53: bool(false)
54: --------
55: -------- line length=5
56: 2: %s
57: bool(false)
58: --------
59: -------- line length=6
60: 2: %s
61: bool(false)
62: --------
63: -------- line length=7
64: 2: %s
65: bool(false)
66: --------
67: -------- line length=8
68: 2: %s
69: bool(false)
70: --------
71: -------- line length=9
72: 2: %s
73: bool(false)
74: --------
75: -------- line length=10
76: 2: %s
77: bool(false)
78: --------
79: -------- line length=11
80: 2: %s
81: bool(false)
82: --------
83: -------- line length=12
84: 2: %s
85: bool(false)
86: --------
87: -------- line length=13
88: 2: %s
89: bool(false)
90: --------
91: -------- line length=14
92: 2: %s
93: bool(false)
94: --------
95: -------- line length=15
96: 2: %s
97: bool(false)
98: --------
99: -------- line length=16
100: 2: %s
101: bool(false)
102: --------
103: -------- line length=17
104: 2: %s
105: bool(false)
106: --------
107: -------- line length=18
108: 2: %s
109: bool(false)
110: --------
111: -------- line length=19
112: 2: %s
113: bool(false)
114: --------
115: -------- line length=20
116: 2: %s
117: bool(false)
118: --------
119: -------- line length=21
120: 2: %s
121: bool(false)
122: --------
123: -------- line length=22
124: 2: %s
125: bool(false)
126: --------
127: -------- line length=23
128: 2: %s
129: bool(false)
130: --------
131: -------- line length=24
132: 2: %s
133: bool(false)
134: --------
135: -------- line length=25
136: 2: %s
137: bool(false)
138: --------
139: -------- line length=26
140: 2: %s
141: bool(false)
142: --------
143: -------- line length=27
144: 2: %s
145: bool(false)
146: --------
147: -------- line length=28
148: 2: %s
149: bool(false)
150: --------
151: -------- line length=29
152: 2: %s
153: bool(false)
154: --------
155: -------- line length=30
156: 2: %s
157: bool(false)
158: --------
159: -------- line length=31
160: 2: %s
161: bool(false)
162: --------
163: -------- line length=32
164: 2: %s
165: bool(false)
166: --------
167: -------- line length=33
168: 2: %s
169: bool(false)
170: --------
171: -------- line length=34
172: 2: %s
173: bool(false)
174: --------
175: -------- line length=35
176: 2: %s
177: bool(false)
178: --------
179: -------- line length=36
180: string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?=
181: =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?=
182: =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?=
183: =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?=
184: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
185: =?ISO-2022-JP?B?GyRCJVclaxsoQg==?=
186: =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?=
187: =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?=
188: =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?=
189: =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?=
190: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
191: -------- bool(true)
192: -------- line length=37
193: string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?=
194: =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?=
195: =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?=
196: =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?=
197: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
198: =?ISO-2022-JP?B?GyRCJVclaxsoQg==?=
199: =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?=
200: =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?=
201: =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?=
202: =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?=
203: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
204: -------- bool(true)
205: -------- line length=38
206: string(396) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?=
207: =?ISO-2022-JP?B?GyRCJXMlVxsoQg==?=
208: =?ISO-2022-JP?B?GyRCJWtKOBsoQg==?=
209: =?ISO-2022-JP?B?GyRCO3pOcxsoQg==?=
210: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
211: =?ISO-2022-JP?B?GyRCJVclaxsoQg==?=
212: =?ISO-2022-JP?B?GyRCSjg7ehsoQg==?=
213: =?ISO-2022-JP?B?GyRCTnNGfBsoQg==?=
214: =?ISO-2022-JP?B?GyRCS1w4bBsoQg==?=
215: =?ISO-2022-JP?B?GyRCJUYlLRsoQg==?=
216: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
217: -------- bool(true)
218: -------- line length=39
219: string(236) "From: =?ISO-2022-JP?B?GyRCJTUbKEI=?=
220: =?ISO-2022-JP?B?GyRCJXMlVyVrSjgbKEI=?=
221: =?ISO-2022-JP?B?GyRCO3pOcyU1JXMbKEI=?=
222: =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?=
223: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwbKEI=?=
224: =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?="
225: -------- bool(true)
226: -------- line length=40
227: string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
228: =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?=
229: =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?=
230: =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?=
231: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?=
232: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
233: -------- bool(true)
234: -------- line length=41
235: string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
236: =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?=
237: =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?=
238: =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?=
239: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?=
240: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
241: -------- bool(true)
242: -------- line length=42
243: string(236) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
244: =?ISO-2022-JP?B?GyRCJVcla0o4O3obKEI=?=
245: =?ISO-2022-JP?B?GyRCTnMlNSVzJVcbKEI=?=
246: =?ISO-2022-JP?B?GyRCJWtKODt6TnMbKEI=?=
247: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYbKEI=?=
248: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
249: -------- bool(true)
250: -------- line length=43
251: string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcxsoQg==?=
252: =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?=
253: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?=
254: =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bBsoQg==?=
255: =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?="
256: -------- bool(true)
257: -------- line length=44
258: string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?=
259: =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?=
260: =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?=
261: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?=
262: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
263: -------- bool(true)
264: -------- line length=45
265: string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?=
266: =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?=
267: =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?=
268: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?=
269: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
270: -------- bool(true)
271: -------- line length=46
272: string(212) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?=
273: =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcxsoQg==?=
274: =?ISO-2022-JP?B?GyRCJVcla0o4O3pOcxsoQg==?=
275: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLRsoQg==?=
276: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
277: -------- bool(true)
278: -------- line length=47
279: string(176) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWsbKEI=?=
280: =?ISO-2022-JP?B?GyRCSjg7ek5zJTUlcyVXJWsbKEI=?=
281: =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYbKEI=?=
282: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
283: -------- bool(true)
284: -------- line length=48
285: string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?=
286: =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?=
287: =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?=
288: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
289: -------- bool(true)
290: -------- line length=49
291: string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?=
292: =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?=
293: =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?=
294: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
295: -------- bool(true)
296: -------- line length=50
297: string(180) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?=
298: =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjgbKEI=?=
299: =?ISO-2022-JP?B?GyRCO3pOc0Z8S1w4bCVGJS0bKEI=?=
300: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
301: -------- bool(true)
302: -------- line length=51
303: string(152) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKOBsoQg==?=
304: =?ISO-2022-JP?B?GyRCO3pOcyU1JXMlVyVrSjg7ehsoQg==?=
305: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?="
306: -------- bool(true)
307: -------- line length=52
308: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?=
309: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?=
310: =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?="
311: -------- bool(true)
312: -------- line length=53
313: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?=
314: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?=
315: =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?="
316: -------- bool(true)
317: -------- line length=54
318: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?=
319: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfBsoQg==?=
320: =?ISO-2022-JP?B?GyRCS1w4bCVGJS0lOSVIGyhC?="
321: -------- bool(true)
322: -------- line length=55
323: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMbKEI=?=
324: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnNGfEtcOGwbKEI=?=
325: =?ISO-2022-JP?B?GyRCJUYlLSU5JUgbKEI=?="
326: -------- bool(true)
327: -------- line length=56
328: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?=
329: =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?=
330: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
331: -------- bool(true)
332: -------- line length=57
333: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?=
334: =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?=
335: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
336: -------- bool(true)
337: -------- line length=58
338: string(148) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?=
339: =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYbKEI=?=
340: =?ISO-2022-JP?B?GyRCJS0lOSVIGyhC?="
341: -------- bool(true)
342: -------- line length=59
343: string(152) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNRsoQg==?=
344: =?ISO-2022-JP?B?GyRCJXMlVyVrSjg7ek5zRnxLXDhsJUYlLRsoQg==?=
345: =?ISO-2022-JP?B?GyRCJTklSBsoQg==?="
346: -------- bool(true)
347: -------- line length=60
348: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?=
349: =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?="
350: -------- bool(true)
351: -------- line length=61
352: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?=
353: =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?="
354: -------- bool(true)
355: -------- line length=62
356: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?=
357: =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?="
358: -------- bool(true)
359: -------- line length=63
360: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcbKEI=?=
361: =?ISO-2022-JP?B?GyRCJWtKODt6TnNGfEtcOGwlRiUtJTklSBsoQg==?="
362: -------- bool(true)
363: -------- line length=64
364: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?=
365: =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?="
366: -------- bool(true)
367: -------- line length=65
368: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?=
369: =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?="
370: -------- bool(true)
371: -------- line length=66
372: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?=
373: =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?="
374: -------- bool(true)
375: -------- line length=67
376: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVclaxsoQg==?=
377: =?ISO-2022-JP?B?GyRCSjg7ek5zRnxLXDhsJUYlLSU5JUgbKEI=?="
378: -------- bool(true)
379: -------- line length=68
380: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?=
381: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?="
382: -------- bool(true)
383: -------- line length=69
384: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?=
385: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?="
386: -------- bool(true)
387: -------- line length=70
388: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?=
389: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?="
390: -------- bool(true)
391: -------- line length=71
392: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3obKEI=?=
393: =?ISO-2022-JP?B?GyRCTnNGfEtcOGwlRiUtJTklSBsoQg==?="
394: -------- bool(true)
395: -------- line length=72
396: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?=
397: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?="
398: -------- bool(true)
399: -------- line length=73
400: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?=
401: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?="
402: -------- bool(true)
403: -------- line length=74
404: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?=
405: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?="
406: -------- bool(true)
407: -------- line length=75
408: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOcxsoQg==?=
409: =?ISO-2022-JP?B?GyRCRnxLXDhsJUYlLSU5JUgbKEI=?="
410: -------- bool(true)
411: -------- line length=76
412: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?=
413: =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?="
414: -------- bool(true)
415: -------- line length=77
416: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?=
417: =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?="
418: -------- bool(true)
419: -------- line length=78
420: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?=
421: =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?="
422: -------- bool(true)
423: -------- line length=79
424: string(120) "From: =?ISO-2022-JP?B?GyRCJTUlcyVXJWtKODt6TnMlNSVzJVcla0o4O3pOc0Z8S1wbKEI=?=
425: =?ISO-2022-JP?B?GyRCOGwlRiUtJTklSBsoQg==?="
426: -------- bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>