1--TEST--
2mb_send_mail() test 7 (lang=Korean)
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (!function_exists("mb_send_mail") || !mb_language("Korean")) {
8    die("skip mb_send_mail() not available");
9}
10if (!@mb_internal_encoding('ISO-2022-KR')) {
11    die("skip ISO-2022-KR encoding is not available on this platform");
12}
13?>
14--INI--
15sendmail_path={MAIL:{PWD}/mb_send_mail07.eml}
16mail.add_x_header=off
17--FILE--
18<?php
19$to = 'example@example.com';
20
21/* default setting */
22mb_send_mail($to, mb_language(), "test");
23readfile(__DIR__ . "/mb_send_mail07.eml");
24
25/* Korean */
26if (mb_language("korean")) {
27    mb_internal_encoding('EUC-KR');
28    mb_send_mail($to, "�׽�Ʈ ".mb_language(), "�׽�Ʈ");
29    readfile(__DIR__ . "/mb_send_mail07.eml");
30}
31
32/* Note: The subject line below, "=?ISO-2022-KR?B?GyQpQw5FVz06Ri4PIEtvcmVhbg==?=",
33 * used to be "=?ISO-2022-KR?B?GyQpQw5FVz06Ri4PIEtvcmVhbg8=?=". That was because
34 * the Base64-encoded ISO-2022-KR string contained an extraneous 0xF ('shift out')
35 * byte. 'Shift out' is only needed to return to ASCII mode, but the string
36 * contained one despite already being in ASCII mode. */
37?>
38--CLEAN--
39<?php
40@unlink(__DIR__ . "/mb_send_mail07.eml");
41?>
42--EXPECTF--
43To: example@example.com
44Subject: %s
45MIME-Version: 1.0
46Content-Type: text/plain; charset=%s
47Content-Transfer-Encoding: %s
48
49%s
50To: example@example.com
51Subject: =?ISO-2022-KR?B?GyQpQw5FVz06Ri4PIEtvcmVhbg==?=
52MIME-Version: 1.0
53Content-Type: text/plain; charset=ISO-2022-KR
54Content-Transfer-Encoding: 7bit
55
56$)CEW=:F.
57