File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Test of oddball text encodings which are not tested elsewhere
3
+ --EXTENSIONS--
4
+ mbstring
5
+ --SKIPIF--
6
+ <?php
7
+ if (getenv ("SKIP_SLOW_TESTS " )) die ("skip slow test " );
8
+ ?>
9
+ --FILE--
10
+ <?php
11
+ mb_substitute_character (0x25 );
12
+
13
+ // "7bit". This is not a real text encoding.
14
+ var_dump (mb_convert_encoding ("ABC " , "7bit " , "ASCII " ));
15
+ var_dump (mb_convert_encoding ("\x80" , "7bit " , "ASCII " ));
16
+ var_dump (mb_convert_encoding ("ABC " , "8bit " , "7bit " ));
17
+ echo "7bit done \n" ;
18
+
19
+ // "8bit"
20
+ var_dump (mb_convert_encoding ("\x01\x00" , "8bit " , "UTF-16BE " )); // codepoints over 0xFF are illegal for '8-bit'
21
+ echo "8bit done \n" ;
22
+
23
+ ?>
24
+ --EXPECT--
25
+ string(3) "ABC"
26
+ string(1) "%"
27
+ string(3) "ABC"
28
+ 7bit done
29
+ string(1) "%"
30
+ 8bit done
You can’t perform that action at this time.
0 commit comments