Annotation of embedaddon/php/ext/mbstring/tests/bug30549.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #30549 (incorrect character translations for some ISO8859 charsets)
3: --SKIPIF--
4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5: --FILE--
6: <?php
7: test('ISO-8859-7', array(0xa4 => 0x20ac, 0xa5 => 0x20af, 0xaa => 0x037a));
8: test('ISO-8859-8', array(0xaf => 0x00af, 0xfd => 0x200e, 0xfe => 0x200f));
9: test('ISO-8859-10', array(0xa4 => 0x012a ));
10:
11: function test($enc, $map) {
12: print "$enc\n";
13:
14: foreach($map as $fromc => $toc) {
15: $ustr = mb_convert_encoding(pack('C', $fromc), 'UCS-4BE', $enc);
16: foreach (unpack('Nc', $ustr) as $unic);
17: printf("0x%04x, 0x%04x\n", $toc, $unic);
18: }
19: }
20: ?>
21: --EXPECT--
22: ISO-8859-7
23: 0x20ac, 0x20ac
24: 0x20af, 0x20af
25: 0x037a, 0x037a
26: ISO-8859-8
27: 0x00af, 0x00af
28: 0x200e, 0x200e
29: 0x200f, 0x200f
30: ISO-8859-10
31: 0x012a, 0x012a
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>