1--TEST-- 2Character encoding test 3--EXTENSIONS-- 4filter 5--FILE-- 6<?php 7$flags = FILTER_FLAG_ENCODE_AMP|FILTER_FLAG_ENCODE_LOW|FILTER_FLAG_ENCODE_HIGH; 8 9for ($i = 0; $i < 256; $i++) { 10 var_dump(filter_var(chr($i), FILTER_UNSAFE_RAW, array("flags" => $flags))); 11} 12?> 13--EXPECT-- 14string(4) "�" 15string(4) "" 16string(4) "" 17string(4) "" 18string(4) "" 19string(4) "" 20string(4) "" 21string(4) "" 22string(4) "" 23string(4) "	" 24string(5) " " 25string(5) "" 26string(5) "" 27string(5) " " 28string(5) "" 29string(5) "" 30string(5) "" 31string(5) "" 32string(5) "" 33string(5) "" 34string(5) "" 35string(5) "" 36string(5) "" 37string(5) "" 38string(5) "" 39string(5) "" 40string(5) "" 41string(5) "" 42string(5) "" 43string(5) "" 44string(5) "" 45string(5) "" 46string(1) " " 47string(1) "!" 48string(1) """ 49string(1) "#" 50string(1) "$" 51string(1) "%" 52string(5) "&" 53string(1) "'" 54string(1) "(" 55string(1) ")" 56string(1) "*" 57string(1) "+" 58string(1) "," 59string(1) "-" 60string(1) "." 61string(1) "/" 62string(1) "0" 63string(1) "1" 64string(1) "2" 65string(1) "3" 66string(1) "4" 67string(1) "5" 68string(1) "6" 69string(1) "7" 70string(1) "8" 71string(1) "9" 72string(1) ":" 73string(1) ";" 74string(1) "<" 75string(1) "=" 76string(1) ">" 77string(1) "?" 78string(1) "@" 79string(1) "A" 80string(1) "B" 81string(1) "C" 82string(1) "D" 83string(1) "E" 84string(1) "F" 85string(1) "G" 86string(1) "H" 87string(1) "I" 88string(1) "J" 89string(1) "K" 90string(1) "L" 91string(1) "M" 92string(1) "N" 93string(1) "O" 94string(1) "P" 95string(1) "Q" 96string(1) "R" 97string(1) "S" 98string(1) "T" 99string(1) "U" 100string(1) "V" 101string(1) "W" 102string(1) "X" 103string(1) "Y" 104string(1) "Z" 105string(1) "[" 106string(1) "\" 107string(1) "]" 108string(1) "^" 109string(1) "_" 110string(1) "`" 111string(1) "a" 112string(1) "b" 113string(1) "c" 114string(1) "d" 115string(1) "e" 116string(1) "f" 117string(1) "g" 118string(1) "h" 119string(1) "i" 120string(1) "j" 121string(1) "k" 122string(1) "l" 123string(1) "m" 124string(1) "n" 125string(1) "o" 126string(1) "p" 127string(1) "q" 128string(1) "r" 129string(1) "s" 130string(1) "t" 131string(1) "u" 132string(1) "v" 133string(1) "w" 134string(1) "x" 135string(1) "y" 136string(1) "z" 137string(1) "{" 138string(1) "|" 139string(1) "}" 140string(1) "~" 141string(6) "" 142string(6) "€" 143string(6) "" 144string(6) "‚" 145string(6) "ƒ" 146string(6) "„" 147string(6) "…" 148string(6) "†" 149string(6) "‡" 150string(6) "ˆ" 151string(6) "‰" 152string(6) "Š" 153string(6) "‹" 154string(6) "Œ" 155string(6) "" 156string(6) "Ž" 157string(6) "" 158string(6) "" 159string(6) "‘" 160string(6) "’" 161string(6) "“" 162string(6) "”" 163string(6) "•" 164string(6) "–" 165string(6) "—" 166string(6) "˜" 167string(6) "™" 168string(6) "š" 169string(6) "›" 170string(6) "œ" 171string(6) "" 172string(6) "ž" 173string(6) "Ÿ" 174string(6) " " 175string(6) "¡" 176string(6) "¢" 177string(6) "£" 178string(6) "¤" 179string(6) "¥" 180string(6) "¦" 181string(6) "§" 182string(6) "¨" 183string(6) "©" 184string(6) "ª" 185string(6) "«" 186string(6) "¬" 187string(6) "­" 188string(6) "®" 189string(6) "¯" 190string(6) "°" 191string(6) "±" 192string(6) "²" 193string(6) "³" 194string(6) "´" 195string(6) "µ" 196string(6) "¶" 197string(6) "·" 198string(6) "¸" 199string(6) "¹" 200string(6) "º" 201string(6) "»" 202string(6) "¼" 203string(6) "½" 204string(6) "¾" 205string(6) "¿" 206string(6) "À" 207string(6) "Á" 208string(6) "Â" 209string(6) "Ã" 210string(6) "Ä" 211string(6) "Å" 212string(6) "Æ" 213string(6) "Ç" 214string(6) "È" 215string(6) "É" 216string(6) "Ê" 217string(6) "Ë" 218string(6) "Ì" 219string(6) "Í" 220string(6) "Î" 221string(6) "Ï" 222string(6) "Ð" 223string(6) "Ñ" 224string(6) "Ò" 225string(6) "Ó" 226string(6) "Ô" 227string(6) "Õ" 228string(6) "Ö" 229string(6) "×" 230string(6) "Ø" 231string(6) "Ù" 232string(6) "Ú" 233string(6) "Û" 234string(6) "Ü" 235string(6) "Ý" 236string(6) "Þ" 237string(6) "ß" 238string(6) "à" 239string(6) "á" 240string(6) "â" 241string(6) "ã" 242string(6) "ä" 243string(6) "å" 244string(6) "æ" 245string(6) "ç" 246string(6) "è" 247string(6) "é" 248string(6) "ê" 249string(6) "ë" 250string(6) "ì" 251string(6) "í" 252string(6) "î" 253string(6) "ï" 254string(6) "ð" 255string(6) "ñ" 256string(6) "ò" 257string(6) "ó" 258string(6) "ô" 259string(6) "õ" 260string(6) "ö" 261string(6) "÷" 262string(6) "ø" 263string(6) "ù" 264string(6) "ú" 265string(6) "û" 266string(6) "ü" 267string(6) "ý" 268string(6) "þ" 269string(6) "ÿ" 270