Merge #11606: improved body_encode algorithm, no longer produces overlong lines