debugd: Encode non-UTF8 log content in base64.

This CL encodes any non-UTF8 log content in base64 before returning the
content over DBus as the DBus library gives an assertion on non-UTF8
strings.

BUG=chromium-os:35310
TEST=Manually inject non-UTF8 characters to /var/log/messages, e.g.

    echo -e '\xef\xbf\xbc' >> /var/log/messages

and then verify that the 'syslog' section in chrome://system shows a
base64-encoded string of /var/log/messages.

Change-Id: Ib907c19aee9270b7984f3978b3fa58fd86b52738
Reviewed-on: https://gerrit.chromium.org/gerrit/35531
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 files changed
tree: 434d1b6acfd19c48d9e9d3a26d29c6324624e23d
  1. doc/
  2. share/
  3. src/
  4. .gitignore
  5. Makefile
  6. OWNERS
  7. README