chunking - Why does PHP chunk_split() default to a chunk length of 76? -


can explain why 76 characters default, , why might useful in practice?

because rfc 2045 semantics specify encoded lines must not longer 76 characters, not counting trailing crlf.

addendum: [warning: highly pedantic presentation follows]

there several different mechanisms "content-transfer-encoding" , 2 of main methods (for discussion) "quoted-printable" , "base64".

quoted-printable encoding intended represent data correspond printable characters in us-ascii character set. base64 content-transfer-encoding designed represent arbitrary sequences of data in form need not humanly readable. both encodings transform input arbitrary domain material safe carry on restricted transports.

"restricted transports" means transport can handle 7-bit data, i.e. acoustic modems , analog lines. in other words, it's designed reliable in crappy conditions.

because quoted-printable expected line-oriented , because rfc 2045 dates 1996 seems reasonable assume spec writers expected text seen on 80 column crt or printed dot-matrix printer or tty. if true, 76 character default desire accommodate lowest common denominator of available display technology.

if you're wondering why mess base64 in case of text-only transport because there several kinds of substrings cannot generated according quoted-printable encoding rules. base64 doesn't have these same restrictions makes use sensible.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -