Do not encode newline characters for abort/log.

The isprint call will return false for chars such as newlines, which
means that the values '\n' and '\t' get encoded which was not the
intent of encodeding the abort and log messages. Add two oct_encode
versions, one that encodes all non-ascii values and only non-printable
ascii values for abort and log data. The other encoding function encodes
all chars that fail isprint() which is used for extra crash data.

Add new unit tests to verify that characters like newlines are not
encoded in the right places.

Bug: 381259755

Test: All unit tests pass.
Change-Id: I682f10e13a2e80ddfa7e87dfdf8181342eb22374
5 files changed