123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- --TEST--
- htmlentities() / htmlspecialchars() ENT_SUBSTITUTE EUC-JP
- --FILE--
- <?php
- $tests = array(
- "\x8F\xA1\xFF", //2 sub as 2nd is potentially valid as lead
- "\x8F\xA1", //2 sub, as 2nd is potentially valid as lead
- "\x8F", //1 sub
- "\x8F\xA0", //1 sub, A0 is not valid as sole/first byte
- "\x8F\xA1\x21", //2 sub, no consume last
- "\x8F\x21", //1 sub, no consume last
- "\x8E\xAE", //valid
- "\x8E", //1 sub
- "\x8E\x21", //1 sub, no consume last
- "\xB2\xFF", //1 sub
- "\xB2", //1 sub
- "\xB2\x21", //1 sub, no consume last
- "\xA0", //1 sub
- );
- foreach ($tests as $test) {
- $a = htmlentities($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP");
- var_dump($a, bin2hex($a));
- $a = htmlspecialchars($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP");
- var_dump($a, bin2hex($a));
- echo "\n";
- }
- ?>
- --EXPECTF--
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(16) "��"
- string(32) "262378464646443b262378464646443b"
- string(16) "��"
- string(32) "262378464646443b262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(16) "��"
- string(32) "262378464646443b262378464646443b"
- string(16) "��"
- string(32) "262378464646443b262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(17) "��!"
- string(34) "262378464646443b262378464646443b21"
- string(17) "��!"
- string(34) "262378464646443b262378464646443b21"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(9) "�!"
- string(18) "262378464646443b21"
- string(9) "�!"
- string(18) "262378464646443b21"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(2) "Ž®"
- string(4) "8eae"
- string(2) "Ž®"
- string(4) "8eae"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(9) "�!"
- string(18) "262378464646443b21"
- string(9) "�!"
- string(18) "262378464646443b21"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(9) "�!"
- string(18) "262378464646443b21"
- string(9) "�!"
- string(18) "262378464646443b21"
- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d
- string(8) "�"
- string(16) "262378464646443b"
- string(8) "�"
- string(16) "262378464646443b"
|