in reply to Size and anatomy of an HTTP response
It relies on utf8::downgrade to check$ perl -MHTTP::Message -e" $a = HTTP::Message->new; $a->content( chr(5 +00) )" HTTP::Message content must be bytes at -e line 1 $ perl -e"print utf8::is_utf8( chr(500) )" 1
Converts in-place the internal octet sequence in *UTF-X* to the equivalent octet sequence in the native encoding (Latin-1 or EBCDIC). *$string* already encoded as native 8 bit does no harm. Can be used to make sure that the UTF-8 flag is off, e.g. when you want to make sure that the substr() or length() function works with the usually faster byte algorithm.$success = utf8::downgrade($string[, FAIL_OK])
|
---|