1--TEST--
2Test of oddball text encodings which are not tested elsewhere
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
8?>
9--FILE--
10<?php
11mb_substitute_character(0x25);
12
13// "7bit". This is not a real text encoding.
14var_dump(mb_convert_encoding("ABC", "7bit", "ASCII"));
15var_dump(mb_convert_encoding("\x80", "7bit", "ASCII"));
16var_dump(mb_convert_encoding("ABC", "8bit", "7bit"));
17var_dump(mb_check_encoding(chr(255), '7bit'));
18var_dump(mb_convert_encoding("\xAC\xAC", '7bit', 'UHC'));
19echo "7bit done\n";
20
21// "8bit"
22var_dump(mb_convert_encoding("\x01\x00", "8bit", "UTF-16BE")); // codepoints over 0xFF are illegal for '8-bit'
23echo "8bit done\n";
24
25?>
26--EXPECT--
27string(3) "ABC"
28string(1) "%"
29string(3) "ABC"
30bool(false)
31string(1) "%"
327bit done
33string(1) "%"
348bit done
35