Python3/encoding fixes for CSV processing.

Change-Id: Icdee66acdfcb1cbfd248e7b356c67fc77d588fb5