The underlying APIs changed between Python2 and Python3, where
once they returned a string, they now return bytes. This change
enforces the decoding of the returned value as a UTF-8. Failure
to decode is handled by the existing exception handling.
Tests were updated to mimic the new API.
Change-Id: I98b474840a163f60e98aed0f75bc6b9df2a9aa00
Story: 2003343
Task: 24381