Python 3 fix field encoding/decoding.

Change-Id: I4842fa22cec6c1ba1d7b1434e0b1ec25f2755a29