Annotation of embedaddon/php/ext/mbstring/tests/overload02.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Function overloading test 2
3: --SKIPIF--
4: <?php
5: extension_loaded('mbstring') or die('skip mbstring not available');
6: if (!function_exists("mail")) {
7: die('skip mail() function is not available.');
8: }
9: if (!function_exists("mb_ereg_replace")) {
10: die('skip mb_ereg_replace() function is not available.');
11: }
12: ?>
13: --INI--
14: output_handler=
15: mbstring.func_overload=7
16: mbstring.internal_encoding=EUC-JP
17: --FILE--
18: <?php
19: echo mb_internal_encoding()."\n";
20:
21: $ngchars = array('ǽ','ɽ','»½','¥½');
22: $str = '¸µÏ½ÍÜ»½Ðò¼Òº¾µ½É½¸½Ç½ÎÏɽ¼¨±½ÌÈÄä˽ÎÏŽÉÕ¹½Ê¸·½»ÒͽÃÎñ½Æ¬¥½¥Õ¥¡¡¼';
23: $converted_str = mb_convert_encoding($str, 'Shift_JIS');
24: mb_regex_encoding('Shift_JIS');
25: foreach($ngchars as $c) {
26: $c = mb_convert_encoding($c, 'Shift_JIS');
27: $replaced = mb_convert_encoding(ereg_replace($c, '!!', $converted_str), mb_internal_encoding(), 'Shift_JIS');
28: var_dump(strpos($replaced, '!!'));
29: }
30: ?>
31: --EXPECT--
32: EUC-JP
33: int(10)
34: int(8)
35: int(3)
36: int(29)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>