--TEST--
Character encoding test
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php 
$flags = FILTER_FLAG_ENCODE_AMP|FILTER_FLAG_ENCODE_LOW|FILTER_FLAG_ENCODE_HIGH;

for ($i = 0; $i < 256; $i++) {
	var_dump(filter_var(chr($i), FILTER_SANITIZE_STRING, array("flags" => $flags)));
}
?>
--EXPECT--
string(4) "&#0;"
string(4) "&#1;"
string(4) "&#2;"
string(4) "&#3;"
string(4) "&#4;"
string(4) "&#5;"
string(4) "&#6;"
string(4) "&#7;"
string(4) "&#8;"
string(4) "&#9;"
string(5) "&#10;"
string(5) "&#11;"
string(5) "&#12;"
string(5) "&#13;"
string(5) "&#14;"
string(5) "&#15;"
string(5) "&#16;"
string(5) "&#17;"
string(5) "&#18;"
string(5) "&#19;"
string(5) "&#20;"
string(5) "&#21;"
string(5) "&#22;"
string(5) "&#23;"
string(5) "&#24;"
string(5) "&#25;"
string(5) "&#26;"
string(5) "&#27;"
string(5) "&#28;"
string(5) "&#29;"
string(5) "&#30;"
string(5) "&#31;"
string(1) " "
string(1) "!"
string(5) "&#34;"
string(1) "#"
string(1) "$"
string(1) "%"
string(5) "&#38;"
string(5) "&#39;"
string(1) "("
string(1) ")"
string(1) "*"
string(1) "+"
string(1) ","
string(1) "-"
string(1) "."
string(1) "/"
string(1) "0"
string(1) "1"
string(1) "2"
string(1) "3"
string(1) "4"
string(1) "5"
string(1) "6"
string(1) "7"
string(1) "8"
string(1) "9"
string(1) ":"
string(1) ";"
string(0) ""
string(1) "="
string(1) ">"
string(1) "?"
string(1) "@"
string(1) "A"
string(1) "B"
string(1) "C"
string(1) "D"
string(1) "E"
string(1) "F"
string(1) "G"
string(1) "H"
string(1) "I"
string(1) "J"
string(1) "K"
string(1) "L"
string(1) "M"
string(1) "N"
string(1) "O"
string(1) "P"
string(1) "Q"
string(1) "R"
string(1) "S"
string(1) "T"
string(1) "U"
string(1) "V"
string(1) "W"
string(1) "X"
string(1) "Y"
string(1) "Z"
string(1) "["
string(1) "\"
string(1) "]"
string(1) "^"
string(1) "_"
string(1) "`"
string(1) "a"
string(1) "b"
string(1) "c"
string(1) "d"
string(1) "e"
string(1) "f"
string(1) "g"
string(1) "h"
string(1) "i"
string(1) "j"
string(1) "k"
string(1) "l"
string(1) "m"
string(1) "n"
string(1) "o"
string(1) "p"
string(1) "q"
string(1) "r"
string(1) "s"
string(1) "t"
string(1) "u"
string(1) "v"
string(1) "w"
string(1) "x"
string(1) "y"
string(1) "z"
string(1) "{"
string(1) "|"
string(1) "}"
string(1) "~"
string(6) "&#127;"
string(6) "&#128;"
string(6) "&#129;"
string(6) "&#130;"
string(6) "&#131;"
string(6) "&#132;"
string(6) "&#133;"
string(6) "&#134;"
string(6) "&#135;"
string(6) "&#136;"
string(6) "&#137;"
string(6) "&#138;"
string(6) "&#139;"
string(6) "&#140;"
string(6) "&#141;"
string(6) "&#142;"
string(6) "&#143;"
string(6) "&#144;"
string(6) "&#145;"
string(6) "&#146;"
string(6) "&#147;"
string(6) "&#148;"
string(6) "&#149;"
string(6) "&#150;"
string(6) "&#151;"
string(6) "&#152;"
string(6) "&#153;"
string(6) "&#154;"
string(6) "&#155;"
string(6) "&#156;"
string(6) "&#157;"
string(6) "&#158;"
string(6) "&#159;"
string(6) "&#160;"
string(6) "&#161;"
string(6) "&#162;"
string(6) "&#163;"
string(6) "&#164;"
string(6) "&#165;"
string(6) "&#166;"
string(6) "&#167;"
string(6) "&#168;"
string(6) "&#169;"
string(6) "&#170;"
string(6) "&#171;"
string(6) "&#172;"
string(6) "&#173;"
string(6) "&#174;"
string(6) "&#175;"
string(6) "&#176;"
string(6) "&#177;"
string(6) "&#178;"
string(6) "&#179;"
string(6) "&#180;"
string(6) "&#181;"
string(6) "&#182;"
string(6) "&#183;"
string(6) "&#184;"
string(6) "&#185;"
string(6) "&#186;"
string(6) "&#187;"
string(6) "&#188;"
string(6) "&#189;"
string(6) "&#190;"
string(6) "&#191;"
string(6) "&#192;"
string(6) "&#193;"
string(6) "&#194;"
string(6) "&#195;"
string(6) "&#196;"
string(6) "&#197;"
string(6) "&#198;"
string(6) "&#199;"
string(6) "&#200;"
string(6) "&#201;"
string(6) "&#202;"
string(6) "&#203;"
string(6) "&#204;"
string(6) "&#205;"
string(6) "&#206;"
string(6) "&#207;"
string(6) "&#208;"
string(6) "&#209;"
string(6) "&#210;"
string(6) "&#211;"
string(6) "&#212;"
string(6) "&#213;"
string(6) "&#214;"
string(6) "&#215;"
string(6) "&#216;"
string(6) "&#217;"
string(6) "&#218;"
string(6) "&#219;"
string(6) "&#220;"
string(6) "&#221;"
string(6) "&#222;"
string(6) "&#223;"
string(6) "&#224;"
string(6) "&#225;"
string(6) "&#226;"
string(6) "&#227;"
string(6) "&#228;"
string(6) "&#229;"
string(6) "&#230;"
string(6) "&#231;"
string(6) "&#232;"
string(6) "&#233;"
string(6) "&#234;"
string(6) "&#235;"
string(6) "&#236;"
string(6) "&#237;"
string(6) "&#238;"
string(6) "&#239;"
string(6) "&#240;"
string(6) "&#241;"
string(6) "&#242;"
string(6) "&#243;"
string(6) "&#244;"
string(6) "&#245;"
string(6) "&#246;"
string(6) "&#247;"
string(6) "&#248;"
string(6) "&#249;"
string(6) "&#250;"
string(6) "&#251;"
string(6) "&#252;"
string(6) "&#253;"
string(6) "&#254;"
string(6) "&#255;"
